WiktionaryParser
WiktionaryParser copied to clipboard
Lookup gives definition from wrong language; possibly related to "see also"
With current master, I still get definitions from a wrong language in some cases. It happens when I look up "nao" and "nami" for Swahili.
Both of these have a "See also" link at the top. Maybe that confuses the parser?
https://en.wiktionary.org/wiki/nami#Swahili https://en.wiktionary.org/wiki/nao#Swahili
Script:
#!/usr/bin/env python3
from pprint import pprint
import sys
from wiktionaryparser import WiktionaryParser
parser = WiktionaryParser()
parser.set_default_language('swahili')
word = parser.fetch(sys.argv[1])
pprint(word)
./lookup-word nami
[{'definitions': [{'examples': [],
'partOfSpeech': 'noun',
'relatedWords': [],
'text': ['nami', 'younger sister']},
"younger sister" is Comanche, not Swahili.
@tbm thank you for reporting this! It definitely seems to be a bug which is weird since both pages have a ToC. Let me take a look