I tried the example from the README but it returns an empty array. FreeLing is installed from the dpkg downloaded from the FreeLing site. MeCab isn't installed.
dpkg -l | grep freeling
ii freeling 3.1 amd64 Library of natural language analysis facilities.
I piped the following through pry:
require 've'
provider = Ve::Manager.provider_for(:en, :words)
parse = provider.parse('I like melons.')
parse.send(:words)
I get:
[1] pry(main)> require 've'
/home/rgh/.gem/ruby/2.2.0/gems/ve-0.0.3/lib/providers/japanese_transliterators.rb:100: warning: duplicated key at line 101 ignored: "gwi"
/home/rgh/.gem/ruby/2.2.0/gems/ve-0.0.3/lib/providers/japanese_transliterators.rb:100: warning: duplicated key at line 101 ignored: "gwu"
/home/rgh/.gem/ruby/2.2.0/gems/ve-0.0.3/lib/providers/japanese_transliterators.rb:100: warning: duplicated key at line 101 ignored: "gwe"
/home/rgh/.gem/ruby/2.2.0/gems/ve-0.0.3/lib/providers/japanese_transliterators.rb:100: warning: duplicated key at line 101 ignored: "gwo"
=> true
[2] pry(main)> provider = Ve::Manager.provider_for(:en, :words)
=> #<Ve::Provider::FreelingEn:0x007fdb841021d0
@config={:app=>"/usr/bin/analyzer", :path=>"", :flags=>"-f /usr/share/FreeLing/config/en.cfg --flush --nonumb --nodate"},
@stderr=#<IO:fd 12>,
@stdin=#<IO:fd 9>,
@stdout=#<IO:fd 10>>
[3] pry(main)> parse = provider.parse('I like melons.')
=> #<Ve::Parse::FreelingEn:0x007fdb84239080 @text="I like melons.", @tokens=[]>
[4] pry(main)> parse.send(:words)
=> []
[5] pry(main)>
I initially thought it was -f /usr/share/FreeLing/config/en.cfg flag as this path doesn't exist. The path is /usr/share/freeling/config/en.cfg. So I'm symlinked /usr/share/FreeLing to /usr/share/freeling but it made no difference.
If I run it on the command line it works analyze seems to return something sensible (I've never used FreeLing before):
echo "I like melons." | analyze --locale=en_AU.UTF-8 -f /usr/share/FreeLing/config/en.cfg --flush --nonumb --nodate
I i PRP 1
like like IN 0.867653
melons melon NNS 1
. . Fp 1
I wondered if it might be the locale option (I don't have en_US.UTF-8 installed) and analyze fails without it but after adding locale it still returned an empty array.
I tried the example from the README but it returns an empty array. FreeLing is installed from the dpkg downloaded from the FreeLing site. MeCab isn't installed.
I piped the following through pry:
I get:
I initially thought it was
-f /usr/share/FreeLing/config/en.cfgflag as this path doesn't exist. The path is/usr/share/freeling/config/en.cfg. So I'm symlinked/usr/share/FreeLingto/usr/share/freelingbut it made no difference.If I run it on the command line it works
analyzeseems to return something sensible (I've never used FreeLing before):I wondered if it might be the locale option (I don't have en_US.UTF-8 installed) and
analyzefails without it but after adding locale it still returned an empty array.