Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Consider using a <em>non-deterministic</em> <a href="http://en.wikipedia.org/wiki/Trie" rel="nofollow">trie automaton</a> covering the full set of recognized suffixes, but analyzing the word backwards. Being non-deterministic means the machine can be in multiple states at once, and the machine as a whole is in an accepting state if any of those states are accepting.</p> <p>The initial state would be an accept state so it could recognize no suffix (as in English <code>be</code>). From the initial state, transitions <code>()</code>, <code>('e', 'z', 'i')</code>, <code>('e', 'd', 'a')</code> and <code>('e', 'v', 'o')</code> for example would all arrive at accepting states, and you don't have to worry about the conflicting <code>'e'</code>s when using an NFA.</p> <p>From the initial state the "characters" of each word are fed in backwards. Each time the machine lands in an accept state, the remaining part of the word is looked up in your <code>lemmaformdict</code> and all the results are kept. Then processing continues until the machine's state is null (not merely non-accepting).</p> <p>At that point the total choices of lemmas indicated along the way lead to the possible interpretations of that word removed from context (and that should always be a small number).</p> <p>Exactly how you implement an NFA will determine the performance. NFAs can be converted into DFAs once constructed, so that the machine has only one state at any given time, so that might help performance without complicating construction of the machine. On the downside, you have to work with the input on an individual character level, which for Python may cost you in performance. (But if performance is <em>that</em> precious, maybe you should switch to C++.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload