Closed neta-elad closed 1 year ago
Adds a server mode to Lexurgy, where requested and responses are formatted as JSON and sent via stdin and stdout (respectively). Request format:
{"words": ["word1", "word2"], "startAt": "rule1", "stopBefore": "rule2", "traceWords": ["word2"], "romanize": false}
All fields other than "words" are optional.
"words"
Response format is either a successful change:
{"type": "changed", "words": ["word1 changed", "word2 changed"], "intermediates": {"intermediate1": ["word1 interim", "word2 interim"]}, "traceLines": ["Tracing word1", "Applied rule1: word1 -> word1 interim"]}
Or an error:
{"type": "error", "message": "Rule application failed...", "stackTrace": [...]}
I tested this in my own project and saw speed-ups of ~20x per query.
Adds a server mode to Lexurgy, where requested and responses are formatted as JSON and sent via stdin and stdout (respectively). Request format:
All fields other than
"words"
are optional.Response format is either a successful change:
Or an error:
I tested this in my own project and saw speed-ups of ~20x per query.