zyxw59 / rssc Goto Github PK
View Code? Open in Web Editor NEWRust rewrite of zyxw59/soundchanger and zyxw59/conlang
License: MIT License
Rust rewrite of zyxw59/soundchanger and zyxw59/conlang
License: MIT License
The current syntax (&(a_b |(c_ _d))
is unintuitive and a bit hard to read. It would be nice to have an infix syntax. The main challenge is grouping — (
is already a valid character to start a regex, so there's some parsing ambiguity if it's also used to group environments.
Currently, the tokenization and parsing functions return errors saying what went wrong if something fails to tokenize or parse properly, but don't say where it went wrong (e.g. line or character numbers).
README should describe the current state of development, and once there is a usable binary, describe its usage similarly to the README for the Go version of this project
Currently, the plan is to use LALRPOP to generate a parser for the rule file grammar. However, I don't know how easy it is to use LALRPOP with the custom tokenizer in the token
module. Additionally, LALRPOP itself takes a long time to compile and has a lot of requirements, so it would be nice to cut it out.
I think using regex (even the current custom implementation) is not actually a great fit for matching sound change rules. A bespoke engine that tracks exactly the state required to confirm or reject a match would be easier to work with and optimize.
The engine should work similarly to the regex engine, stepping thru the input string one token at a time while maintaining the state of the match. It should also handle collapsing identical states to reduce blowup.
The state should include:
{0:C}
and the like)For a rule with a single positive environment, it should be included in the search. Negative environments probably need to be handled afterward, since a token-by-token approach isn't great at looking for what shouldn't be there. If there are multiple positive environments joined by an 'and', they might also have to be handled afterward, unless we can find a way for the engine to fail a search based on the results of another search.
The replacement function should take a Vec<rule::re::Engine>
, a CategoryMap
, and a TokenString
, and produce a new TokenString
by applying all applicable Engine
s.
Will need to prune the Engines
by only selecting the first applicable Engine
for each position in the input, including dealing with overlapping matches.
Syllable boundaries would be represented by some character that could be inserted by rules into words, and also match at word boundaries. I don't think attempting to dynamically syllabify input words is feasible.
There needs to be some syntax to declare user-defined tokens (e.g. a user might want to treat sh
as a single token if it represents a single phoneme in their language).
I'm not sure how I want to do this. Token declarations have to be parsed before the rule file is tokenized. The options I've thought of are:
tokens path/to/file
)These two options are not mutually exclusive though, and it would be nice to allow both forms.
Currently, src/rssc.lalrpop
just defines the syntax for regular expressions, but not syntax for:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.