hylo-lang / Lotsawa

A Swift implementation of the MARPA algorithms
Apache License 2.0
18 stars 2 forks source link

Vocabulary in recognizer code #8

Open jeffreykegler opened 2 years ago

jeffreykegler commented 2 years ago

I've given the recognizer code a couple of readings, and two comments:

I take it the PartialParses object is more or less what's called an "Earley table" in the literature. Analogous with what I suggested for PartialParse, I'd suggest the name be changed to make it easier for a reader to see the connection to the Earley literature.

"Earleme" seems to be used as a synonym for "Earley set". In my usage it refers to locations, and differs from "Earley set ID" or "Earley set ordinal" only when variable length tokens are in use, and there are locations without Earley sets. If you are not currently implementing that feature, I would not use the term "earleme" at all, to avoid confusion with the concept in my writings.

I can see how the confusion might arise, because you'll see me use phrases like "look for a prediction at an earleme" all the time in the Marpa literature, where the meaning is very close to "look for a prediction in an Earley set". And perhaps I used the term loosely at points. But, analogous to "Earley item" and "Earley table", best to track the terms in the literature, when all else is equal.