lib/smshelper/languagetools/languagetools.rb in smshelper-0.1.3 vs lib/smshelper/languagetools/languagetools.rb in smshelper-0.2.0
- old
+ new
@@ -29,9 +29,10 @@
(post "TextGetLanguage", :extra_query => {:text => text})["language"]
end
end
class Charset
+ include Singleton
GSM_CHARSET = "@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ\e\f^{}\\[~]|€ÆæßÉ !\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà".scan(/./u)
ESCAPED_CHARS = "{}\\~[]|€"
# Returns +true+ if the supplied text contains only characters from
# GSM 03.38 charset, otherwise it returns +false+.
def is_gsm(text)