Class: Course::Assessment::Question::TextResponseLemmaService

Inherits:
Object
  • Object
show all
Defined in:
app/services/course/assessment/question/text_response_lemma_service.rb

Instance Method Summary collapse

Instance Method Details

#lemmatise(word_array) ⇒ Array<String>

Returns Words in lemma form

Parameters:

  • word_array (Array<String>)

    Words to lemmatise

Returns:

  • (Array<String>)

    Words in lemma form


6
7
8
# File 'app/services/course/assessment/question/text_response_lemma_service.rb', line 6

def lemmatise(word_array)
  word_array.flat_map { |word| WordNet::Synset.morphy_all(word) || word }.uniq
end