0.0
No commit activity in last 3 years
No release in over 3 years
Freeling client wrapper with API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 10.3
 Project Readme

Freeling::Client

Simple client wrapper for Freeling analyzer tool. For only works with this options. If you need to install freeling on Ubuntu 14.04 just follow this guide.

Example of usage:

require 'freeling_client'

text <<-EOF
Malcolm X was effectively orphaned early in life. His father was killed when he was six and his mother was placed in a mental hospital when he was thirteen, after which he lived in a series of foster homes.
EOF

options = {
  timeout: 200,
  config: 'config.cfg',
  fidn: 'ident.dat'
}

# Using the language detection tool
lang_detector = FreelingClient::LanguageDetector.new options
lang_detector.detect(text) # => :en

# Morphological, morpho with PoS tagging, tagged words and nec analysis
analyzer = FreelingClient::Analyzer.new options
analyzer.call(:morfo, text)
analyzer.call(:tagged, text)
analyzer.call(:tagged_sense, text)
analyzer.call(:tagged_ned, text)

# Using as a client
# You will need to setup the server first. Check bellow
options = {
  server: 'localhost',
  port: 50005
}

freeling_client = FreelingClient::Client.new options
freeling_client.call(text)

Running Freeling as a server

Performing morphological analysis:

FREELINGSHARE=/usr/local/share/freeling/ analyzer \
-f config/freeling/analyzer.cfg --server --port 50005 --inpf plain --outf morfo

Performing morphological with PoS tagging:

FREELINGSHARE=/usr/local/share/freeling/ analyzer \
-f config/freeling/analyzer.cfg --server --port 50005 --inpf plain --outf tagged

Asking for the senses of the tagged words:

FREELINGSHARE=/usr/local/share/freeling/ analyzer \
-f config/freeling/analyzer.cfg --server --port 50005 --inpf plain --outf sense --sense all

With nec analysis:

FREELINGSHARE=/usr/local/share/freeling/ analyzer \
-f config/freeling/analyzer.cfg --server --port 50005 --inpf plain --outf tagged --nec --noflush

Testing Freeling stand-alone

FREELINGSHARE=/usr/local/share/freeling/ analyzer -f config/freeling/analyzer.cfg --inpf plain --locale es_ES.UTF-8 --outf morfo --noflush < file.txt