Sha256: 00752923691cc9b42c65db805f41852384769cfb0c60031855f7e623598d5880

Contents?: true

Size: 341 Bytes

Versions: 2

Compression:

Stored size: 341 Bytes

Contents

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

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

sentence = "I live in New York"
doc = nlp.read(sentence)

puts "Before: " + doc.tokens.map(&:text).join(", ")

doc.retokenize(3, 4)

puts "After: " + doc.tokens.map(&:text).join(", ")

# Before: I, live, in, New, York
# After: I, live, in, New York

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-spacy-0.1.4.1 examples/linguistic_features/retokenize_2.rb
ruby-spacy-0.1.4 examples/linguistic_features/retokenize_2.rb