7ef05274835b2272b1b431d3633d0559db684197,textblob/translate.py,Translator,_get_translation_from_json5,#Translator#Any#,71
Before Change
pos = 2
while True:
m = self.translation_pattern.match(content, pos)
if not m:
break
result += m.group(1)
pos = m.end()
return _unescape(result)
def _get_json5(self, url, host=None, type_=None, data=None):
encoded_data = urlencode(data).encode("utf-8")
After Change
def _get_translation_from_json5(self, content):
result = u""
json_data = json.loads(content)
if "sentences" in json_data:
result = "".join([s["trans"] for s in json_data["sentences"]])
return _unescape(result)
def _get_json5(self, url, host=None, type_=None, data=None):
encoded_data = urlencode(data).encode("utf-8")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: sloria/TextBlob
Commit Name: 7ef05274835b2272b1b431d3633d0559db684197
Time: 2015-06-08
Author: jschnurr@gmail.com
File Name: textblob/translate.py
Class Name: Translator
Method Name: _get_translation_from_json5
Project Name: nipunsadvilkar/pySBD
Commit Name: 29d9d12a26718405763103e997285026f8fd4563
Time: 2020-07-21
Author: nipunsadvilkar@gmail.com
File Name: pysbd/segmenter.py
Class Name: Segmenter
Method Name: sentences_with_char_spans
Project Name: sloria/TextBlob
Commit Name: 7ef05274835b2272b1b431d3633d0559db684197
Time: 2015-06-08
Author: jschnurr@gmail.com
File Name: textblob/translate.py
Class Name: Translator
Method Name: _get_translation_from_json5
Project Name: snipsco/snips-nlu
Commit Name: f83dd115acb0d119fa466fad51b473a30749f684
Time: 2017-05-11
Author: clement.doumouro@snips.ai
File Name: snips_nlu/intent_parser/regex_intent_parser.py
Class Name: RegexIntentParser
Method Name: get_slots