a1622041867f42a071f1d0711b85f31e3ea6e332,ner_v2/detectors/numeral/number/standard_number_detector.py,BaseNumberDetector,_get_unit_from_text,#BaseNumberDetector#Any#Any#,102

Before Change


        unit_choices = "|".join(self.units_map)
        unit_matches = re.findall(r"((" + unit_choices + r")?[\.\,\s]*?" + detected_original + r"\s*(" + unit_choices +
                                  r")?)", processed_text, re.UNICODE)
        if unit_matches:
            original_text = original_text[0][0].strip()
            unit_pre = unit_matches[0][1].strip()
            unit_suc = unit_matches[0][2].strip()
            if unit_pre:
                unit = self.units_map[unit_pre]
            elif unit_suc:
                unit = self.units_map[unit_suc]
        return unit, original_text

    def _detect_number_from_numerals(self, number_list=None, original_list=None):
        

After Change


        unit_choices = "|".join(self.units_map)
        unit_matches = re.search(r"((" + unit_choices + r")?[\.\,\s]*" + detected_original + r"\s*(" + unit_choices +
                                 r")?)", processed_text, re.UNICODE)
        original_text, unit_prefix, unit_suffix = unit_matches.groups()
        original_text = original_text.strip()
        if unit_suffix:
            unit = self.units_map[unit_suffix.strip()]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: hellohaptik/chatbot_ner
Commit Name: a1622041867f42a071f1d0711b85f31e3ea6e332
Time: 2018-12-12
Author: amans.rlx@gmail.com
File Name: ner_v2/detectors/numeral/number/standard_number_detector.py
Class Name: BaseNumberDetector
Method Name: _get_unit_from_text


Project Name: bashtage/linearmodels
Commit Name: 25aec3291e63d54ad3f71b9ba95f9d5b9132793f
Time: 2017-11-30
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/asset_pricing/model.py
Class Name: TradedFactorModel
Method Name: from_formula


Project Name: bashtage/linearmodels
Commit Name: 25aec3291e63d54ad3f71b9ba95f9d5b9132793f
Time: 2017-11-30
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/asset_pricing/model.py
Class Name: LinearFactorModel
Method Name: from_formula