lib/myaso/mystem.rb
# Analyzes a +word+ and returns an array of lemmas, each of which
# represent a particular ambiguous morphological interpretation.
#
# :call-seq:
#   analyze(String)
Analyzes a +word+ and returns an array of lemmas, each of which
represent a particular ambiguous morphological interpretation.


Analyzes a + word + and returns an array of lemmas each of which represent a particular ambiguous morphological interpretation .
def analyze(word)
    Array.new.tap do |lemmas|
      invoke_analyze(as_symbols(word), word.length) do |lemma|
        lemma_text = MystemLemmaText(lemma)
        lemma_text_len = MystemLemmaTextLen(lemma)
        form_text = MystemLemmaForm(lemma)
        form_text_len = MystemLemmaFormLen(lemma)
        stem_grammemes = MystemLemmaStemGram(lemma).bytes
        flex_grammemes_raw = MystemLemmaFlexGram(lemma)
        flex_grammemes_len = MystemLemmaFlexGramNum(lemma)
        flex_grammemes = as_strings(flex_grammemes_raw, flex_grammemes_len)
        grammemes = stem_grammemes | flex_grammemes
        lemmas << Lemma.new(
          as_string(lemma_text, lemma_text_len),        
          as_string(form_text, form_text_len),          
          QUALITY[MystemLemmaQuality(lemma)],           
          Myasorubka::Mystem::Binary.to_msd(grammemes), 
          stem_grammemes,                               
          flex_grammemes,                               
          MystemLemmaFlexLen(lemma),                    
          MystemLemmaRuleId(lemma)                      
        )
      end
    end
  end
def analyze ( word ) Array . new . tap do | lemmas | invoke_analyze ( as_symbols ( word ) , word . length ) do | lemma | lemma_text = MystemLemmaText ( lemma ) lemma_text_len = MystemLemmaTextLen ( lemma ) form_text = MystemLemmaForm ( lemma ) form_text_len = MystemLemmaFormLen ( lemma ) stem_grammemes = MystemLemmaStemGram ( lemma ) . bytes flex_grammemes_raw = MystemLemmaFlexGram ( lemma ) flex_grammemes_len = MystemLemmaFlexGramNum ( lemma ) flex_grammemes = as_strings ( flex_grammemes_raw , flex_grammemes_len ) grammemes = stem_grammemes | flex_grammemes lemmas << Lemma . new ( as_string ( lemma_text , lemma_text_len ) , as_string ( form_text , form_text_len ) , QUALITY [ MystemLemmaQuality ( lemma ) ] , Myasorubka :: Mystem :: Binary . to_msd ( grammemes ) , stem_grammemes , flex_grammemes , MystemLemmaFlexLen ( lemma ) , MystemLemmaRuleId ( lemma ) ) end end end
Analyzes a +word+ and returns an array of lemmas, each of which
represent a particular ambiguous morphological interpretation.
Analyzes a + word + and returns an array of lemmas each of which represent a particular ambiguous morphological interpretation .
# lemma # form # quality # msd # stem_grammemes # flex_grammemes # flex_length # rule_id
word
<not_specific>