optimization of “_morph” function
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Lightproof |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
At the moment, the result of the command “analyze” is stored as a string for each words in a global array, and we split it each times we need to know the morphologies of a word. Instead of doing it repeatedly, we can do it once for each word.
def _morph(rLoc, word, pattern, onlyaffix):
global analyses
if word == None:
return None
if word not in analyses:
x = spellchecker.
if not x:
return None
t = x.getAlternatives()
if not t:
t = [""]
a = analyses[
[...]
New function :
def _morph(rLoc, word, pattern, onlyaffix):
global analyses
if word == None:
return None
if word not in analyses:
x = spellchecker.
if not x:
return None
t = x.getAlternatives()
if not t:
t = [""]
a = analyses[word]
[...]
Changed in lightproof: | |
status: | New → Fix Committed |