Download the PHP package ssola/monachus without Composer
On this page you can find all versions of the php package ssola/monachus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ssola/monachus
More information about ssola/monachus
Files in ssola/monachus
Package monachus
Short Description Library to handle texts, includes: Spell checker, Stemer, Language detection
License
Informations about the package monachus
Monachus 
Monachus is a library that helps you working with text, in any language. Monachus means Monk in Latin language, I think it's a good name to define this library. Monks were used to work a lot with books (strings) in a wide range of languages.
This library has been created keeping in mind these PHP versions: 5.5, 5.4, 5.3
Install
The simplest way is with Composer, just add these lines to your composer.json:
"repositories": [
{
"type": "git",
"url": "https://github.com/ssola/monachus.git"
}
]
How it works
String
The first thing we need to know is how to use the String class. This class generates an object with a specific text. It will preserve that text in UTF-8 charset along the way.
Obviously this code is generating a new String object with a value and then it's printed.
Then you can do things like:
This kind of objects is used extensively in this library in order to perform all the actions with the proper charset.
Tokenizer
Do you need to tokenize a string? Monachus can do it for you! We support a lot of languages, Japanese included! But if your language is not supported... relax! You can create your own adapters in order to tokenize different languages.
Let's do a simple example:
As you have seen, we can use our own adapters to tokenize complex languages like Japanase or Chinese. Now it's time to explain you how to create these adapters.
N-Gram
Yeah! Monachus is able to generate different levels of N-gram sequences, for example a bigram or trigram. But let's see how it works.
Do you need your own N-gram parser? No problem! You can create your own parsers as well.
And then...