+ @match[lang] = Hash.new\r
+ @match[lang][:in] = Regexp.new("\\b(?:" + ar_in.uniq.map { |txt|\r
+ Regexp.escape(txt)\r
+ }.join('|') + ")\\b", Regexp::IGNORECASE) unless ar_in.empty?\r
+ @match[lang][:out] = Regexp.new("\\b(?:" + ar_out.uniq.map { |txt|\r
+ Regexp.escape(txt)\r
+ }.join('|') + ")\\b", Regexp::IGNORECASE) unless ar_out.empty?\r
+ @match[lang][:both] = Regexp.new("\\b(?:" + ar_both.uniq.map { |txt|\r
+ Regexp.escape(txt)\r
+ }.join('|') + ")\\b", Regexp::IGNORECASE) unless ar_both.empty?\r
+ @match[lang][:dest] = Regexp.new("\\b(?:" + ar_dest.uniq.map { |txt|\r
+ Regexp.escape(txt)\r
+ }.join('|') + ")\\b", Regexp::IGNORECASE) unless ar_dest.empty?\r
+ }\r
+ @punct = /\s*[.,:!;?]?\s*/ # Punctuation\r
+\r
+ # Languages to match for, in order\r
+ @match_langs.clear\r
+ @match_langs << @main_lang if @match.key?(@main_lang)\r
+ @match_langs << :english if @match.key?(:english)\r
+ @match.each_key { |key|\r
+ @match_langs << key\r