Project

ots

0.02
No commit activity in last 3 years
No release in over 3 years
Ruby interface to libots libraries for unix.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

OTS

ots is an interface to libots - The Open Text Summarizer.

Dependencies

  • ruby 1.9.1 or later
  • libxml2
  • glib2.0
  • homebrew (on MacOSX)

Installation

Debian flavors of Linux


  # ruby & ruby development libraries (not needed if you use rvm)
  sudo apt-get install ruby1.9.1-dev ruby1.9.1

  # libxml2 and glib development libraries
  sudo apt-get install libxml2-dev libglib2.0-dev

  # install ots
  gem install ots

MacOSX


 # update homebrew to latest & greatest version
 GIT_SSL_NO_VERIFY=1 brew update

 # optional: macosx normally has libxml2 installed if not try
 brew install libxml2

 # install glib
 brew install glib

 # setup the environment variables in order to install ots
 export CPPFLAGS=-I/usr/local/Cellar/glib/2.30.2/include/glib-2.0/
 export LDFLAGS=-L/usr/local/Cellar/glib/2.30.2/lib/
 export PKG_CONFIG_PATH=/usr/local/Cellar/glib/2.30.2/lib/pkgconfig/
 
 # install ots
 gem install ots

API

  OTS
    .parse        #=> OTS::Article
    .languages    #=> Array

  OTS::Article
    .new
    #topics       #=> Array
    #keywords     #=> Array
    #summarize    #=> Array

Usage

  require 'ots'
  article = OTS.parse("I think I need some ice cream to cool me off. It is too hot down under")
  article = OTS.parse("j'ai besoin de la crème glacée. il fait trop chaud en australie.", language: "fr")
  article = OTS.parse("j'ai besoin de la crème glacée. il fait trop chaud en australie.", dictionary: "custom.xml")

  article.topics
  article.keywords
  article.summarize(percent: 50)
  article.summarize(sentences: 1)

  OTS.languages #=> list of supported language dictionaries baked-in to libots

See Also

https://github.com/ssoper/summarize

License

MIT