4db89675ad761bd14eaf219644f526bc4dde7b70,scripts/nmt/bleu.py,,_split_compound_word,#Any#,49

Before Change


    for word in segment:
        if r.match(word) is not None:
            words = word.split("-")
            words.insert(1, "////AT////-////AT////")
            new_segment.extend(words)
        else:
            new_segment.append(word)
    return new_segment

After Change


    new_segment = []
    for word in segment:
        if r.match(word) is not None:
            words = ["////AT////-////AT////" if w == "-" else w for w in re.split("(-)", word)]
            new_segment.extend(words)
        else:
            new_segment.append(word)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 4db89675ad761bd14eaf219644f526bc4dde7b70
Time: 2018-06-13
Author: szhengac@users.noreply.github.com
File Name: scripts/nmt/bleu.py
Class Name:
Method Name: _split_compound_word


Project Name: tzutalin/labelImg
Commit Name: 6958e69851567abb18bfece52888d4709bbacc5b
Time: 2017-08-03
Author: tzu.ta.lin@gmail.com
File Name: tests/test_io.py
Class Name:
Method Name:


Project Name: PetrochukM/PyTorch-NLP
Commit Name: 2a1a6851344172e0134f3c5f4f5c1021975f2812
Time: 2018-03-11
Author: petrochukm@gmail.com
File Name: torchnlp/samplers/bucket_batch_sampler.py
Class Name: BucketBatchSampler
Method Name: __iter__