You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been playing with the package recently and I have experienced some issues.
The program seems to struggle with larger texts. At first I suspected, there might be an unreasonable amount of copying involved. After some debugging, I've came to conclusion, that this is in fact a problem with stack related to usage of recursion.
Reproduction example:
letgrammar=Grammar(start:"initial"){"initial"-->n("initial")<+>t("a")<|>t()}letparser=EarleyParser(grammar: grammar)lettext=String.init(repeating:"a", count:2500)letsyntaxTree=try parser.syntaxTree(for: text )
I'm trying to work with files aroung 10K characters. At this time, I am able to work with 2000 characters long texts using this simple grammar.
For the time being, I will try to find a workaroud. I might have time to fix the issue in the future.
The text was updated successfully, but these errors were encountered:
I have been able to solve recursion of EarleyParser.buildSyntaxTrees( ~~~ ).resolve( ~~~ ) but my stress test still does not work, since there is also a recursion on EarleyParser.buildSyntaxTrees( ~~~ ) which now crashes the program.
Since performace is not my main objective, there is a significant performace degradation.
Hello,
I have been playing with the package recently and I have experienced some issues.
The program seems to struggle with larger texts. At first I suspected, there might be an unreasonable amount of copying involved. After some debugging, I've came to conclusion, that this is in fact a problem with stack related to usage of recursion.
Reproduction example:
I'm trying to work with files aroung 10K characters. At this time, I am able to work with 2000 characters long texts using this simple grammar.
For the time being, I will try to find a workaroud. I might have time to fix the issue in the future.
The text was updated successfully, but these errors were encountered: