Sha256: e1a1f3b1a8ee2a6454172f3c9d3f88ae654e9c85171240ec8f4d3b29e8a305db

Contents?: true

Size: 348 Bytes

Versions: 6

Compression:

Stored size: 348 Bytes

Contents

require "ruby-spacy"

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

doc = nlp.read("This is a sentence. This is another sentence.")


puts "doc has annotation SENT_START: " + doc.has_annotation("SENT_START").to_s

doc.sents.each do |sent|
  puts sent.text
end

# doc has annotation SENT_START: true
# This is a sentence.
# This is another sentence.

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-spacy-0.1.4.1 examples/linguistic_features/sentence_segmentation.rb
ruby-spacy-0.1.4 examples/linguistic_features/sentence_segmentation.rb
ruby-spacy-0.1.3 examples/linguistic_features/sentence_segmentation.rb
ruby-spacy-0.1.2 examples/linguistic_features/sentence_segmentation.rb
ruby-spacy-0.1.1 examples/linguistic_features/sentence_segmentation.rb
ruby-spacy-0.1.0 examples/linguistic_features/sentence_segmentation.rb