app/models/wiki_words.rb in Pimki-1.2.092 vs app/models/wiki_words.rb in Pimki-1.3.092
- old
+ new
@@ -1,28 +1,28 @@
# Contains all the methods for finding and replacing wiki words
module WikiWords
# In order of appearance: Latin, greek, cyrillian, armenian
I18N_HIGHER_CASE_LETTERS =
- "ÀÁÂÃÄÅĀĄĂÆÇĆČĈĊĎĐÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌÍÎÏĪĨĬĮİIJĴĶŁĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌŐŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴÝŶŸŹŽŻ" +
- "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" +
- "ΆΈΉΊΌΎΏѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸЖ" +
- "ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՏՐՑՒՓՔՕՖ"
+ "À?ÂÃÄÅĀĄĂÆÇĆČĈĊĎ?ÈÉÊËĒĘĚĔĖĜĞĠĢĤĦÌ?Î?ĪĨĬĮİIJĴĶ?ĽĹĻĿÑŃŇŅŊÒÓÔÕÖØŌ?ŎŒŔŘŖŚŠŞŜȘŤŢŦȚÙÚÛÜŪŮŰŬŨŲŴ?ŶŸŹŽŻ" +
+ "ΑΒΓΔΕΖΗΘΙΚΛΜ?ΞΟΠΡΣΤΥΦΧΨΩ" +
+ "ΆΈΉΊΌΎ?ѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎ?ҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾ?ӃӅӇӉӋ??ӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӸЖ" +
+ "ԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀ?ՂՃՄՅՆՇՈՉՊՋՌ???ՑՒՓՔՕՖ"
I18N_LOWER_CASE_LETTERS =
- "àáâãäåāąăæçćčĉċďđèéêëēęěĕėƒĝğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöøōőŏœŕřŗśšşŝșťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſÐð" +
- "άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώΐ" +
- "абвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљћќѝўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӀӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӹ" +
- "աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆև"
+ "àáâãäå?ąăæçć?ĉċ?đèéêëēęěĕėƒ?ğġģĥħìíîïīĩĭįıijĵķĸłľĺļŀñńňņʼnŋòóôõöø?ő?œŕřŗśšş?șťţŧțùúûüūůűŭũųŵýÿŷžżźÞþßſ?ð" +
+ "άέήίΰαβγδεζηθικλμνξοπ?ςστυφχψωϊϋό?ώ?" +
+ "абвгдежзийклмнопр?туфхцчшщъыь?ю??ёђѓєѕіїјљћќ?ўџѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿ?ҋ??ґғҕҗҙқ?ҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӀӂӄӆӈӊӌӎӑӓӕӗәӛ?ӟӡӣӥӧөӫӭӯӱӳӵӹ" +
+ "աբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտր?ւփքօֆև"
DIGITS = "0123456789"
- WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + DIGITS + ']+[A-Z' + I18N_HIGHER_CASE_LETTERS + DIGITS + ']\w+'
+ WIKI_WORD_PATTERN = '[A-Z' + I18N_HIGHER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + ']+[a-z' + I18N_LOWER_CASE_LETTERS + DIGITS + ']*[A-Z' + I18N_HIGHER_CASE_LETTERS + DIGITS + ']\w+'
def self.separate(wiki_word, ignore_separation = false)
if ignore_separation
wiki_word
else
- wiki_word.gsub(/([a-z#{I18N_LOWER_CASE_LETTERS}])([A-Z#{I18N_HIGHER_CASE_LETTERS}#{DIGITS}])/u, '\1 \2').gsub(/(\d+)/u, ' \1 ')
+ wiki_word.gsub(/([a-z#{I18N_LOWER_CASE_LETTERS}]|[A-Z]{3,})([A-Z#{I18N_HIGHER_CASE_LETTERS}#{DIGITS}])/u, '\1 \2').gsub(/(\d+)/u, ' \1 ')
end
end
end
\ No newline at end of file