Sha256: 336a5df0241a2f3d39daea8908613f6b482339386d3021336566d9e4e630c38f
Contents?: true
Size: 700 Bytes
Versions: 4
Compression:
Stored size: 700 Bytes
Contents
require "ruby-spacy" require "terminal-table" nlp = Spacy::Language.new("ja_core_news_sm") doc = nlp.read("私は論文を読んでいるところだった。") headings = ["text", "lemma"] rows = [] doc.each do |token| rows << [token.text, token.lemma_] end table = Terminal::Table.new rows: rows, headings: headings puts table # +--------+--------+ # | text | lemma | # +--------+--------+ # | 私 | 私 | # | は | は | # | 論文 | 論文 | # | を | を | # | 読ん | 読む | # | で | で | # | いる | いる | # | ところ | ところ | # | だっ | だ | # | た | た | # | 。 | 。 | # +--------+--------+
Version data entries
4 entries across 4 versions & 1 rubygems