github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

postmodern / raingrams

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 4
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • 0.1.2
    • 0.1.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A flexible and general-purpose ngrams library written in Ruby. Raingrams supports ngram sizes greater than 1, text/non-text grams, multiple parsing styles and open/closed vocabulary models. — Read more

  cancel

http://raingrams.rubyforge.org/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Alias the test task to spec. 
postmodern (author)
Wed Sep 09 11:56:01 -0700 2009
commit  f1a12d1fc829a7b787c9cccb01fad65f11506e27
tree    c8b6e58e1edf409fcee0c16291654cb3089cdfcd
parent  5a34fd206b987b00abe276c6074e3667dac0af12
raingrams /
name age
history
message
file .gitignore Loading commit data...
file History.txt
file LICENSE.txt
file Manifest.txt
file README.txt
file Rakefile
file TODO.txt
directory lib/
directory spec/
directory tasks/
README.txt
= Raingrams

* http://raingrams.rubyforge.org/
* http://github.com/postmodern/raingrams/
* Postmodern (postmodern.mod3 at gmail.com)

== DESCRIPTION:
  
Raingrams is a flexible and general-purpose ngrams library written in Ruby.
Raingrams supports ngram sizes greater than 1, text/non-text grams, multiple
parsing styles and open/closed vocabulary models.

== FEATURES:
  
* Supports ngram sizes greater than 1.
* Supports text and non-text grams.
* Supports Open and Closed vocabulary models.
* Supports calculating the similarity and commonality of sample text against
  specified models.
* Supports generating random text from models.

== REQUIREMENTS:

* {nokogiri}[http://nokogiri.rubyforge.org/] >= 1.2.0

== INSTALL:

  $ sudo gem install raingrams

== EXAMPLES:

* Train a model with ycombinator comments:

    require 'raingrams'
    require 'nokogiri'
    require 'open-uri'
    
    include Raingrams
    
    model = BigramModel.build do |model|
      doc = Nokogiri::HTML(open('http://news.ycombinator.org/newcomments'))
      doc.search('span.comment') do |span|
        model.train_with_text(span.inner_text)
      end
    end

* Update a trained model:

    model.train_with_text %{Interesting videos. Anders talks about
      functional support on .net, concurrency, immutability. Guy Steele
      talks about Fortress on JVM. Too bad they are afraid of macros
      (access to AST), though Steele does say Fortress has some support.}
    
    model.refresh

* Generate a random sentence:

    model.random_sentence
    # => "OTOOH if you use slicehost even offer to bash Apple makes it will
    exit and its 38 month ago based configuration of little networks
    created."

* Dump a model to a file, to be marshaled later:

    model.save('path/for/model')

* Load a model from a file:

    Model.open('path/for/model')

== LICENSE:

The MIT License

Copyright (c) 2007-2009 Hal Brodigan

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server