javascript.py 408 B

123456789101112131415161718
  1. from spacy.tokens import Token
  2. from word_processor.parsers import Parser
  3. class JavascriptParser(Parser):
  4. def __init__(self, **kwargs):
  5. super().__init__(**kwargs)
  6. def parse_word(self, word: Token):
  7. return word.lemma_.title()
  8. def parse_words(self, words: [Token]):
  9. parsed_words = super().parse_words(words)
  10. #parsed_words.reverse()
  11. return parsed_words