Zju wrote: ↑Sun Dec 02, 2018 7:17 am
That's always an idea to do, but you can get around it with groups. Currently I have other features on my wishlist.
The "<" is really an arrow. It represents merging / modifying features.
C -> {manner: %m} would change the C into a phone(me) whose only feature was "manner".
C -> <{manner: %m} merges the new manner into the preceding consonant. It's shorthand for (1=C) -> 1<{manner: %m}, where 1 is a capture variable, and 1<{..} is a merger of 1 and {..} with the contents of {..} having priority.
I guess you could think of it like merging dictionaries in a language like Python or Javascript.
Why the less than sign in the output and what would just {%m = manner: ∗ −vowel} do?
Match a phone(me) whose only feature was manner. * at the end means "and whatever other unmentioned features happen to be present".
On a sidenote, maybe I'll have to look into Haskell, R or the like eventually should the lexicons start getting too large.
Not sure I'd recommend either of them for you. It depends what you want.
Haskell isn't an easy language to pick-up if you're coming from a dynamic language like Javascript, or even from something OO-ish like Java or C#. It's more or less strictly functional, it discourages in-place mutation, it's not object orientated, and evaluation is lazy by default which is both a blessing and a curse. Its main user-base is programming language nerds, so half the libraries rely on unnecessarily complicated concepts to work around the restrictions of the language. Most things is Haskell are either unexpectedly easy (writing a regular expression engine) or unexpectedly hard (write a GUI or anything else that relies on global mutable state). I actually like it, but only for some kinds of project.
R... well, the packages are great if you want to do stats. For my taste, the base language is a nasty mess, and it's not that fast either. If you want a general purpose dynamic language, go with Python instead, you'll get much better libraries for everything that isn't stats related.
If you don't mind asking, how are they more appropriate? The three things missing that I can think of (ad-hoc groups, features, matching groups in input/output and condition) can be easily added in the current system.
Though yes, regexes aren't really a replacing engine, just a matching one. I had to sweat a bit before making everything work.
Of course, to a certain extent you can emulate a featural SCA by just building long lists of groups or iterating over possible combinations. I don't remember where it all fell over since it was 2011 when I wrote HaSC, but I did find there was a point where it all fell over and a string regexp engine just wasn't the answer. And as I said, writing my own had perfectly acceptable performance in Haskell, which is compiled to machine code surprisingly quite efficiently. It might not have worked quite so well in Python...