66a06524eba0b22d14204baeb2ca6d4c9db7d1d0,scripts/semantic_types.py,,convert_coq_to_nltk_type,#Any#,245

Before Change


            type_ids.append("e")
        elif type_item.startswith("Prop"):
            type_ids.append("t")
        elif type_item.startswith("Event"):
            type_ids.append("v")
        elif type_item != "->":
            raise(ValueError("Invalid type name: %s in %s" % (type_item, coq_type)))
    assert len(type_ids) > 0
    if len(type_ids) == 1:
        nltk_type_str = type_ids[0]
    else:

After Change


    assert parameter == "Parameter" and colon == ":"
    // This list contains something like ["Entity", "->", "Prop", "->", "Prop"...]
    type_sig = coq_type_list[3:]
    nltk_type_str = " ".join(type_sig).rstrip(".").replace(
        "->", " ").replace(
        "Entity", "e").replace(
        "Prop", "t").replace(
        "Event", "v")
    if not nltk_type_str.startswith("(") or not nltk_type_str.endswith("("):
        nltk_type_str = "(" + nltk_type_str + ")"
    // Add pre-terminals (necessary for NLTK, if we convert to CNF).
    nltk_type_str = re.sub(r"([evt])", r"(N \1)", nltk_type_str)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: mynlp/ccg2lambda
Commit Name: 66a06524eba0b22d14204baeb2ca6d4c9db7d1d0
Time: 2017-05-12
Author: pascual@nii.ac.jp
File Name: scripts/semantic_types.py
Class Name:
Method Name: convert_coq_to_nltk_type


Project Name: fizyr/keras-retinanet
Commit Name: 633702f3f411198f777c14e90b8201151e5b886a
Time: 2018-02-22
Author: lacatusu.valeriu@gmail.com
File Name: keras_retinanet/models/resnet.py
Class Name:
Method Name: download_imagenet


Project Name: deepgram/kur
Commit Name: b01ea16c4fadeb271c2bde653947d92048f367c8
Time: 2017-03-21
Author: ajsyp@syptech.net
File Name: kur/backend/keras_backend.py
Class Name: KerasBackend
Method Name: _restore_keras