All Projects → raypereda → stemmify

raypereda / stemmify

Licence: other
Ruby module that converts a word to its approximate root form with the Porter stemmer. For example, observing and observation reduce to observ.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to stemmify

gwizo
Simple Go implementation of the Porter Stemmer algorithm with powerful features.
Stars: ✭ 26 (-51.85%)
Mutual labels:  stemmer, porter-stemmer-algorithm
Stemmer
An English (Porter2) stemming implementation in Elixir.
Stars: ✭ 134 (+148.15%)
Mutual labels:  stemmer
Ruby Stemmer
Expose libstemmer_c to Ruby
Stars: ✭ 254 (+370.37%)
Mutual labels:  stemmer
Nlp Js Tools French
POS Tagger, lemmatizer and stemmer for french language in javascript
Stars: ✭ 32 (-40.74%)
Mutual labels:  stemmer
Awesome Persian Nlp Ir
Curated List of Persian Natural Language Processing and Information Retrieval Tools and Resources
Stars: ✭ 460 (+751.85%)
Mutual labels:  stemmer
Qutuf
Qutuf (قُطُوْف): An Arabic Morphological analyzer and Part-Of-Speech tagger as an Expert System.
Stars: ✭ 84 (+55.56%)
Mutual labels:  stemmer
CISTEM
Stemmer for German
Stars: ✭ 33 (-38.89%)
Mutual labels:  stemmer
lara-hungarian-nlp
NLP class for rapid ChatBot development in Hungarian language
Stars: ✭ 27 (-50%)
Mutual labels:  stemmer
Arabicstemmer
Assem's Arabic Light Stemmer is a snowball-based stemming algorithm for Arabic aimed mainly to improve search.
Stars: ✭ 102 (+88.89%)
Mutual labels:  stemmer
Arabic Light Stemmer
Arabic light stemmer. Light stemming for Arabic words removes prefixes and suffixes and normalizes words
Stars: ✭ 14 (-74.07%)
Mutual labels:  stemmer
Ptstem
Stemming Algorithms for the Portuguese Language
Stars: ✭ 13 (-75.93%)
Mutual labels:  stemmer
Word forms
Accurately generate all possible forms of an English word e.g "election" --> "elect", "electoral", "electorate" etc.
Stars: ✭ 463 (+757.41%)
Mutual labels:  stemmer
Php Stemmer
Native PHP Stemmer
Stars: ✭ 84 (+55.56%)
Mutual labels:  stemmer
Lunr Languages
A collection of languages stemmers and stopwords for Lunr Javascript library
Stars: ✭ 296 (+448.15%)
Mutual labels:  stemmer
Cadmium
Natural Language Processing (NLP) library for Crystal
Stars: ✭ 172 (+218.52%)
Mutual labels:  stemmer
Akarata
Indonesian stemmer - Pustaka JavaScript untuk mengambil kata dasar dari kata berimbuhan pada bahasa Indonesia.
Stars: ✭ 26 (-51.85%)
Mutual labels:  stemmer
Kelime kok ayirici
Derin Öğrenme Tabanlı - seq2seq - Türkçe için kelime kökü bulma web uygulaması - Turkish Stemmer (tr_stemmer)
Stars: ✭ 76 (+40.74%)
Mutual labels:  stemmer
hunspell
High-Performance Stemmer, Tokenizer, and Spell Checker for R
Stars: ✭ 101 (+87.04%)
Mutual labels:  stemmer
sastrawijs
Indonesian language stemmer. Javascript port of PHP Sastrawi project.
Stars: ✭ 30 (-44.44%)
Mutual labels:  stemmer
Stemmer
Fast Porter stemmer implementation
Stars: ✭ 86 (+59.26%)
Mutual labels:  stemmer

Stemmify

Description

This is a Rails gem for reducing words to their roots. For example, all the following words to are stemmed to “observ”, which is not a real word in this case: observance observances observancy observant observants observation observe observed observer observers observing observingly

The algorithm used here is based on the Porter stemmer. You can read more about Martin Porter's stemmer at

tartarus.org/~martin/PorterStemmer/

Martin Porter explains:

The Porter stemming algorithm (or ‘Porter stemmer’) is a process for removing the commoner morphological and inflexional endings from words in English. Its main use is as part of a term normalisation process that is usually done when setting up Information Retrieval systems.

Install

$ sudo gem install stemmify

or

$ gem install stemmify

Note that while the source code is hosted on github, the actual gem is hosted on RubyGem.org.

Usage

Let's say you are building some sort of search tool. You want searches for “observations” and “observer” to all bring up the same items. When you are building you index, you can map all the words to their roots using the stem method.

Here's an example usage:

require 'stemmify'
print("observations".stem) # ==> "observ"

You can use stemmify as a command line tool:

$ stem input_file.txt
$ printf "I\nwalked\nin\nthe\nforest\n.\n" | stem

Both the file based input and the input taken from the stdin should be tokenized, i.e. provide one token per line, tokens should be delimeted e.g. by a new line feed.

For tokenization consider using a tokenizer, for instance the tokenizer gem.

Test Suite

This test is based on the sample input and output text from Martin Porter website. It includes 23532 test words and their expected stem results. To run the test, just type

rake test

Thanks

Dave Thomas from pragprog.com made speed improvements to this code before it was packaged as a gem.

License

Copyright © 2011 Ray Pereda

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].