35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
sWord = sWord.lower()
if sWord in _dWord:
return _lSet[_dWord[sWord]]
return []
def selectSimil (sWord, sPattern):
"return list of words phonetically similar to sWord and whom POS is matching sPattern"
if not sPattern:
return set(getSimil(sWord))
aSelect = set()
for sSimil in getSimil(sWord):
for sMorph in _dMorph.get(sSimil, []):
if re.search(sPattern, sMorph):
aSelect.add(sSimil)
|
|
|
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
sWord = sWord.lower()
if sWord in _dWord:
return _lSet[_dWord[sWord]]
return []
def selectSimil (sWord, sPattern):
"return a set of words phonetically similar to sWord and whom POS is matching sPattern"
if not sPattern:
return set(getSimil(sWord))
aSelect = set()
for sSimil in getSimil(sWord):
for sMorph in _dMorph.get(sSimil, []):
if re.search(sPattern, sMorph):
aSelect.add(sSimil)
|