b4ec3ea5a927e5ff3736c180157d8a727b67107d,src/fonduer/candidates/mentions.py,Ngrams,apply,#Ngrams#Any#,53

Before Change


                                seen.add(ts)
                                yield ts
                    // And check splits together
                    for word in re.split("|".join(self.split_tokens), text):
                        ts = TemporarySpan(
                            char_start=text.index(word),
                            char_end=text.index(word) + len(word) - 1,
                            sentence=context,
                        )
                        if ts not in seen and ts.get_span():
                            logger.warning(word)
                            seen.add(ts)
                            yield ts


class MentionNgrams(Ngrams):
    Defines the **space** of Mentions.

    Defines the space of Mentions as all n-grams (n_min <= n <= n_max) in a

After Change


                ):
                    text = context.text[start - offsets[0] : end - offsets[0] + 1]
                    start_idxs = [0]
                    end_idxs = []
                    for m in re.finditer(self.split_rgx, text):
                        start_idxs.append(m.end())
                        end_idxs.append(m.start())
                    end_idxs.append(len(text))
                    for start_idx in start_idxs:
                        for end_idx in end_idxs:
                            if start_idx < end_idx:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: HazyResearch/fonduer
Commit Name: b4ec3ea5a927e5ff3736c180157d8a727b67107d
Time: 2018-09-20
Author: senwu@cs.stanford.edu
File Name: src/fonduer/candidates/mentions.py
Class Name: Ngrams
Method Name: apply


Project Name: home-assistant/home-assistant
Commit Name: 2a210607d392cac85bb82dd576877ddb192c85c5
Time: 2018-08-16
Author: prokhorov.max@outlook.com
File Name: homeassistant/components/wemo.py
Class Name:
Method Name: setup


Project Name: Qiskit/qiskit-aqua
Commit Name: 0efa80c13c695b03b180f0d899e4ed340c3d549c
Time: 2018-10-07
Author: chenrich@us.ibm.com
File Name: qiskit_aqua/algorithms/components/feature_maps/pauli_z_expansion.py
Class Name: PauliZExpansion
Method Name: init_args