class FreeGoogle::Extractor
Responsible for extract translated result from a received raw text
Constants
- ENCODE
Public Instance Methods
extract(rawdata)
click to toggle source
Extract translation @param rawdata [String] Raw text without formating @return [String] Translated text
Example of how raw data look like: [[["Olá","Hello",,,10]],,"en"]
# File lib/translators/free_google/extractor.rb, line 17 def extract(rawdata) return "" if rawdata.nil? || rawdata.empty? encoded = rawdata.force_encoding(ENCODE) translations = encoded[/\["(.*?)","/] translations[2..-4] end