Erez Sh
af3bedd39d
Adjustments to logging PR
4 years ago
pwwang
2a73afd355
Change LOGGER to logger
4 years ago
pwwang
5c8a25c733
Avoid using root logger
4 years ago
Erez Sh
dcc98241c1
Improved handling and performance of large grammars
4 years ago
Erez Sh
b9c81a5450
Refactor: Simplify code by assuming rule.options is never None
5 years ago
Erez Sh
0a4530b942
Improved Earley error on EOF (Issue #457 )
5 years ago
Erez Sh
94da6c52b8
Refactored the Earley code to make it thread-safe (Issue #454 )
5 years ago
Erez Shinan
deb325acb4
Pydot now not necessary for earley debug, shows warning instead (Issue #443 )
5 years ago
night199uk
d845aa3bf1
Add debug flag to Early and XEarley to allow dumping the SPPF
5 years ago
Erez Shinan
f1e844accd
Mid work. Not promising
5 years ago
Erez Shinan
bd75bf2dff
Refactor - callbacks are now {rule: callback}, instead of a Callback object referenced by Rule.alias
5 years ago
Erez Shinan
934a997f83
Clean up
6 years ago
Erez Shinan
862a853340
More cleanup of Earley duplication
6 years ago
Erez Sh
4de71293e5
More cleanup
6 years ago
Erez Sh
57a602758d
Merged part of Earley & XEarley implementation. Major reduction
6 years ago
Erez Shinan
65d3212bed
Temporarily disable leo transitives
6 years ago
night199uk
80a09697fe
Rebuild the way Earley prioritizes ambiguities
- Makes rule ordering the default ambiguity tie breaker.
E.g.
start: a | b
a: "A"
b: "A"
will return:
start
a
start: b | a
a: "A"
b: "A"
will return
start
b
- Replaces the ambiguity='resolve__antiscore_sum' with a separate option: 'priority'.
The priority option has 4 values: 'auto', 'none', 'normal', 'invert'.
'Auto' maps to 'Normal' for CYK and Earley and 'None' for LALR.
'None' filters your priorities and ignores them. This saves some extra tree walking on Earley.
'Normal' uses your priorities untouched, mimicing the old behaviour.
'Invert' negates your priorities, emulating the old 'resolve__antiscore_sum' behaviour.
This allows you to use priority logic even when ambiguity=='explicit', to get a better idea
of the shape of your tree; and to easily disable priorities without removing them from the
grammar for testing (or performance).
- ambiguity='explicit' now correctly returns an ambiguous tree again, as 0.6 did.
6 years ago
night199uk
80964e903b
Simplify the way we create Leo sets
Avoids recursion and improves performance slightly
6 years ago
Erez Shinan
76e185a36c
Added the Forest interface for explicit ambiguity
6 years ago
night199uk
04d90fa916
Implement Joop Leo's optimizations for right recursion performance
6 years ago
night199uk
8fa8ac36fc
Remove Earley Column
We can replace Earley Columns with basic python sets
for improved performance and simplicity.
6 years ago
night199uk
bb22c84df3
Speed up repetitive parsing using the same parser
When using the same parser repeatedly for small parsers we incur
significant overhead by recreating the ForestVisitor each parser.
We can cache the Forest walker and re-use it by making it stateless.
Also, we can use slots for all of the Forest Walkers to reduce
construction delay and function call overhead.
6 years ago
Erez Shinan
b2489e13e2
A few fixes (tests + interface)
6 years ago
Erez Shinan
1798971455
Adjustments
6 years ago
night199uk
1d5fd7301a
Heavy modifications to the Earley parser to try and make it handle more
types of ambiguity.
- Rewritten along the lines of Elizabeth Scott's parser.
https://www.sciencedirect.com/science/article/pii/S1571066108001497
- Implement SPPF trees per Elizabeth Scott and Bram van der Sanden's work.
http://www.bramvandersanden.com/post/2014/06/shared-packed-parse-forest/
6 years ago
Erez Shinan
eba99662c4
Bug in pretty printing of Earley derivations (issue #210 )
6 years ago
Erez Shinan
5c6df8e825
Moved and restructured exceptions
* All exceptions are now under exceptions.py
* UnexpectedInput is now superclass of UnexpectedToken and UnexpectedCharacters,
all of which support the get_context() and match_examples() methods.
6 years ago
Erez Shinan
6d76a4ce8d
visitor_args -> v_args
6 years ago
Erez Shinan
6bfc27c11d
New transformers near completion
Nearley tool still needs fixing
6 years ago
Erez Shinan
4864a1cf4d
More work
6 years ago
Erez Shinan
5e546f38a9
args decorators actually work now
6 years ago
Erez Shinan
cf7ddeee88
Earley working too
6 years ago
Erez Shinan
c3bce19dc2
More steps towards a good solution
6 years ago
Erez Shinan
349a607ae3
Some more normalizing
6 years ago
Erez Shinan
b951b5f79c
Significant reduction in memory consumption (Saving only parse-table instead of analysis instance)
6 years ago
Erez Shinan
327cca8c00
Added 'considered_rules' to exceptions, to help users debug
7 years ago
Erez Shinan
07f45a0bd3
Style fixes
7 years ago
Erez Shinan
b90b0a215f
Fixed reconstruct (Issue #72 )
7 years ago
Erez Shinan
3d8b8b4725
A few more adaptations
7 years ago
Ehud Tamir
7c253b9372
Merge CYK parser.
7 years ago
Erez Shinan
39e58cb8fd
Post-refactor cleanup
7 years ago
Erez Shinan
1cc4c965e8
Big Refactor: Grammars now build in half the time. Code shorter & cleaner.
7 years ago
Erez Shinan
5748920df4
BUGFIX in xearley + Feature: earley__predict_all
7 years ago
Erez Shinan
e77433f19a
Superficial improvement to Earley
7 years ago
Erez Shinan
34449651bf
Added UnexpectedInput exception (with line & column) to xearley (Issue #43 )
7 years ago
Erez Shinan
eea569fa3a
Tiny fix
7 years ago
Erez Shinan
0155d3d956
A few more fixes
7 years ago
Erez Shinan
93302d7ceb
Important optimization for fix
7 years ago
Erez Shinan
c93140386d
BUGFIX: The Earley parser collected repeating derivations, and filtered them out much later than needed. This resulted in very long lists and many unnecessary comparisons.
7 years ago
Erez Shinan
551482898c
Fix for earley__all_derivations = False
7 years ago