1

最新バージョンの stanfordparser とそのための ruby​​ ラッパー ライブラリをインストールしました。ウェブサイトの簡単な例でテストしようとすると:

vi test.rb:

require "stanfordparser"

preproc =
StanfordParser::DocumentPreprocessor.new
puts
preproc.getSentencesFromString("This
is a sentence.  So is this.")

ruby -rubygems test.rb

This
is
a
sentence
.
So
is
this
.

これは本当に健全性チェックです - 何か間違ったことをしているのですか、それともパーサーまたはラッパーのバグですか?

4

1 に答える 1

1

puts出力のフォーマット方法について混乱する可能性があります。これを試して:

x = preproc.getSentencesFromString("This is a sentence. So is this.")
puts x.inspect

あなたが得ているはずのものを手に入れていることを確認するために。

于 2011-04-12T23:40:32.097 に答える