lib/unsupervised-language-detection.rb in unsupervised-language-detection-0.0.4 vs lib/unsupervised-language-detection.rb in unsupervised-language-detection-0.0.5
- old
+ new
@@ -1,8 +1,10 @@
-require File.expand_path('../unsupervised-language-detection/language-detector', __FILE__)
+require_relative './unsupervised-language-detection/language-detector'
module UnsupervisedLanguageDetection
def self.is_english_tweet?(tweet)
@detector ||= LanguageDetector.load_yaml(File.expand_path('../unsupervised-language-detection/english-tweet-detector.yaml', __FILE__))
@detector.classify(tweet) == "majority"
end
-end
+end
+
+UnsupervisedLanguageDetection.is_english_tweet?("http://www.test.com/ ")
\ No newline at end of file