Esempio n. 1
0
 def __init__(self, lang, val_popcon, progress=None):
     self.val_popcon = val_popcon
     self.progress = progress
     if lang is None:
         lang = "en"
     self.lang = lang
     self.xlang = lang.split("_")[0]
     self.xdglangs = Locale.expand_languages(lang)
     self.indexer = xapian.TermGenerator()
     # Get a stemmer for this language, if available
     try:
         self.stemmer = xapian.Stem(self.xlang)
         self.indexer.set_stemmer(self.stemmer)
     except xapian.InvalidArgumentError:
         pass
Esempio n. 2
0
 def __init__(self, lang, val_popcon, progress=None):
     self.val_popcon = val_popcon
     self.progress = progress
     if lang is None:
         lang = "en"
     self.lang = lang
     self.xlang = lang.split("_")[0]
     self.xdglangs = Locale.expand_languages(lang)
     self.indexer = xapian.TermGenerator()
     # Get a stemmer for this language, if available
     try:
         self.stemmer = xapian.Stem(self.xlang)
         self.indexer.set_stemmer(self.stemmer)
     except xapian.InvalidArgumentError:
         pass
Esempio n. 3
0
from xdg import Locale

print(Locale.expand_languages())
Esempio n. 4
0
 def test_expand_languages(self):
     langs = Locale.expand_languages()
     assert isinstance(langs, list)
Esempio n. 5
0
 def test_expand_languages(self):
     langs = Locale.expand_languages()
     assert isinstance(langs, list)