Sha256: c8878ea516f18a6b837e37b48b4caa2ea77b395b8bbe08c7e3b9f2300d46d8a3

Contents?: true

Size: 515 Bytes

Versions: 2

Compression:

Stored size: 515 Bytes

Contents

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

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

puts "Pipeline: " + nlp.pipe_names.to_s

doc = nlp.read("I was reading the paper.")

token = doc[0]

puts "Morph features of the first word: " + token.morph.to_s
puts "PronType of the word: " + token.morph.get("PronType").to_s

# Pipeline: ["tok2vec", "tagger", "parser", "ner", "attribute_ruler", "lemmatizer"]
# Morph features of the first word: Case=Nom|Number=Sing|Person=1|PronType=Prs
# PronType of the word: ['Prs']

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-spacy-0.1.1 examples/linguistic_features/morphology.rb
ruby-spacy-0.1.0 examples/linguistic_features/morphology.rb