33375398b8c6096985e34c62684801442922746e,estnltk/text.py,Text,tag_verb_chains,#Text#,920

Before Change


        verbchains = []
        for sentence in sentences:
            chains = self.__verbchain_detector.detectVerbChainsFromSent(sentence)
            offset = 0
            for chain in chains:
                chain[PHRASE] = [idx+offset for idx in chain[PHRASE]]
                chain[START] = self[WORDS][chain[PHRASE][0]][START]
                chain[END] = self[WORDS][chain[PHRASE][-1]][END]
            offset += len(sentence)
            verbchains.extend(chains)
        self[VERB_CHAINS] = verbchains
        return self

After Change


            for chain in chains:
                // 1) Get spans for all words of the phrase
                word_spans = [ ( sentence[idx][START], sentence[idx][END] ) \
                                 for idx in sorted( chain[PHRASE] ) ]
                // 2) Assign to the chain
                chain[START] = [ span[0] for span in word_spans ]
                chain[END]   = [ span[1] for span in word_spans ]
            verbchains.extend(chains)
        self[VERB_CHAINS] = verbchains
        return self
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: estnltk/estnltk
Commit Name: 33375398b8c6096985e34c62684801442922746e
Time: 2015-12-21
Author: siim.orasmaa@ut.ee
File Name: estnltk/text.py
Class Name: Text
Method Name: tag_verb_chains


Project Name: CyberReboot/NetworkML
Commit Name: a9e42a7f1d0ea64be0371a6f7aff5039b5a48f4f
Time: 2017-11-15
Author: CStephenson970@gmail.com
File Name: NodeClassifier/iterator.py
Class Name: BatchIterator
Method Name: gen_data


Project Name: snorkel-team/snorkel
Commit Name: ac8954c34709432e962d535477e3634a60fbde1e
Time: 2016-07-15
Author: ajratner@gmail.com
File Name: ddlite_viewer.py
Class Name: Viewer
Method Name: render