text
Version, currently 0.1.01 version
- 0.1.0latestNov 8, 2016
github.com/johnjansen/text
A collection of phonetic algorithms for Crystal. Including; Porter-Stemmer, Soundex, Metaphone, Double Metaphone & White Similarity
18 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
text:
github: johnjansen/text
version: ~> 0.1.0Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- John Jansen <john.jansen@me.com>
Dependencies
This version declares no dependencies.
README
# Text
[](http://badge.fury.io/gh/johnjansen%2Ftext)
[](https://travis-ci.org/johnjansen/text)
A collection of text algorithms.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
text:
github: johnjansen/text
```
## Usage
```crystal
require "text"
```
### Levenshtein distance
```
Text::Levenshtein.distance('test', 'test')
# => 0
Text::Levenshtein.distance('test', 'tent')
# => 1
Text::Levenshtein.distance('test', 'testing')
# => 3
Text::Levenshtein.distance('test', 'testing', 2)
# => 2
```
### Metaphone
```
Text::Metaphone.metaphone('BRIAN')
# => 'BRN'
Text::Metaphone.double_metaphone('Coburn')
# => ['KPRN', nil]
Text::Metaphone.double_metaphone('Angier')
# => ['ANJ', 'ANJR']
```
### Soundex
```
Text::Soundex.soundex('Knuth')
# => 'K530'
```
### Porter stemming
```
Text::PorterStemming.stem('abatements') # => 'abat'
```
### White similarity
```
white = Text::WhiteSimilarity.new
white.similarity('Healed', 'Sealed') # 0.8
white.similarity('Healed', 'Help') # 0.25
```
## Contributing
1. Fork it ( https://github.com/johnjansen/text/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [johnjansen](https://github.com/johnjansen) John Jansen - creator, maintainer
## Thanks
- Paul Battley (threedaymonk)
- Michael Neumann
- Tim Fletcher
- Hampton Catlin (hcatlin)
- Wilker LĂșcio
- everyone who contributed to https://github.com/threedaymonk/text
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Nov 8, 2016
- Commit
56a9ca8e6fcb- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/johnjansen/text
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 1