Stemmer
Stemmer shard for Crystal that uses Porter stemming algorithm.
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.
Installation
Add this to your application's shard.yml
:
dependencies:
stemmer:
github: hugoabonizio/stemmer.cr
Usage
The method String#stem
or String#stem_porter
returns the stemmed word.
require "stemmer"
"computer".stem # => "comput"
"computation".stem # => "comput"
"computating".stem # => "comput"
"check".stem # => "check"
"checked".stem # => "check"
"checking".stem # => "check"
"checks".stem # => "check"
Contributing
- Fork it ( https://github.com/hugoabonizio/stemmer.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- hugoabonizio Hugo Abonizio - creator, maintainer
This Crystal code was based on stemmify Ruby gem, so thanks to its contributors.