def fullStemmer(text, lastmark): import qalsadi.analex import asmai.anasem import aranasyn.anasyn as arasyn result = [] debug = False limit = 100 analyzer = qalsadi.analex.analex() if lastmark == "0" or not lastmark: analyzer.disableAllowSyntaxLastMark() anasynt = arasyn.SyntaxAnalyzer() anasem = asmai.anasem.SemanticAnalyzer() analyzer.set_debug(debug) analyzer.set_limit(limit) mode = 'all' if mode == 'verb': result = analyzer.check_text_as_verbs(text) elif mode == 'noun': result = analyzer.check_text_as_nouns(text) else: result = analyzer.check_text(text) result, synodelist = anasynt.analyze(result) result = anasem.analyze(result) # the result contains objets return anasynt.decode(result)
def full_stemmer(text, lastmark): """ morphological analysis """ import qalsadi.analex import asmai.anasem import aranasyn.anasyn as arasyn result = [] debug = False limit = 100 analyzer = qalsadi.analex.Analex() if lastmark == "0" or not lastmark: analyzer.disable_syntax_lastmark() anasynt = arasyn.SyntaxAnalyzer() anasem = asmai.anasem.SemanticAnalyzer() analyzer.set_debug(debug) analyzer.set_limit(limit) mode = 'all' result = analyzer.check_text(text) #~result, synodelist = anasynt.analyze(result) result, __ = anasynt.analyze(result) result = anasem.analyze(result) # the result contains objets return anasynt.decode(result)
def full_stemmer(text, lastmark): """ morphological analysis """ import qalsadi.analex import asmai.anasem import aranasyn.anasyn as arasyn result = [] debug = False limit = 100 cpath = os.path.join(os.path.dirname(__file__), '../tmp/') analyzer = qalsadi.analex.Analex(cache_path=cpath) if lastmark == "0" or not lastmark: analyzer.disable_syntax_lastmark() anasynt = arasyn.SyntaxAnalyzer() anasem = asmai.anasem.SemanticAnalyzer() analyzer.set_debug(debug) analyzer.set_limit(limit) analyzer.disable_allow_cache_use() mode = 'all' result = analyzer.check_text(text) #~result, synodelist = anasynt.analyze(result) result, __ = anasynt.analyze(result) result = anasem.analyze(result) # the result contains objets return anasynt.decode(result)