Sha256: 203de34b4894914b787738ffe37fa1bd3a142ea875aaeef98dd61a04440fc46b

Contents?: true

Size: 745 Bytes

Versions: 6

Compression:

Stored size: 745 Bytes

Contents

require "ruby-spacy"
require "terminal-table"

nlp = Spacy::Language.new("en_core_web_sm")

doc = nlp.read("Apple is looking at buying U.K. startup for $1 billion")

headings = [1,2,3,4,5,6,7,8,9,10,11]
row = []

doc.each do |token|
  row << token.text
end

table = Terminal::Table.new rows: [row], headings: headings
puts table

# +-------+----+---------+----+--------+------+---------+-----+---+----+---------+
# | 1     | 2  | 3       | 4  | 5      | 6    | 7       | 8   | 9 | 10 | 11      |
# +-------+----+---------+----+--------+------+---------+-----+---+----+---------+
# | Apple | is | looking | at | buying | U.K. | startup | for | $ | 1  | billion |
# +-------+----+---------+----+--------+------+---------+-----+---+----+---------+

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-spacy-0.1.4.1 examples/get_started/tokenization.rb
ruby-spacy-0.1.4 examples/get_started/tokenization.rb
ruby-spacy-0.1.3 examples/get_started/tokenization.rb
ruby-spacy-0.1.2 examples/get_started/tokenization.rb
ruby-spacy-0.1.1 examples/get_started/tokenization.rb
ruby-spacy-0.1.0 examples/get_started/tokenization.rb