Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
= LanguageDetection Rails plugin It adds +language+ method to String class. It uses Classifier (<tt>gem install classifier</tt>) to try to detect the language, based on the samples present in <tt>RAILS_ROOT/lang/<lang>/*.txt</tt>. This path is configurable: LanguageDetection::LanguageClassifier.samples_dir = "/another/path" To detect the language of a string, simply use the +language+ method: > "hola".language => "es" > "hello".language => "en" Remember this is a bayesian filter, so: * Results are not bullet-proof * And depends on the size and quality of your samples Copyright (c) 2008 Sergio Gil, released under the MIT license