This file was obtained by applying Clone Digger tool to the source code of the NLTK project. The fragments of code, which are cited below, are not necessary clones. Even more so the presense of this code in the project does not lead to defects in it. Unfortuently different source files of NLTK package have different copyrights (although they are all covered by the GPL license). By technical reason it was difficult for me to quote all the copyrights here. I cited only the common part of copyrights (and missed information about concrete authors). Clone Digger is free and I hope that it will help people to produce better software. I respect the work of NLTK authors and hope that they will have nothing against publishing this file. The code below falls under the following license: # Copyright (C) 2001-2008 University of Pennsylvania # Author: ? # URL: http://nltk.sf.net # For license information, see http://clonedigger.sourceforge.net/examples/NLTK_LICENSE.txt
Source files:
/home/peter/clone_digger/nltk-0.9.2/nltk/evaluate.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/containers.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/yamltags.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/probability.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/olac.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/data.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/cfg.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/treetransforms.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/internals.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/featstruct.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/utilities.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/detect.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/compat.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tree.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/sem/evaluate.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/sem/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/sem/logic.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/sem/relextract.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/sem/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/etree/ElementInclude.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/etree/ElementTree.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/etree/ElementPath.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/etree/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/cfg.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/dispersion.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/tree.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/model/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/misc/nemo.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/misc/sort.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/misc/chomsky.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/misc/wordfinder.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/misc/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/chat80.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/xmldocs.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/ppattach.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/bracket_parse.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/ieer.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/wordlist.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/propbank.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/string_category.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/toolbox.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/rte.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/chunked.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/indian.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/tagged.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/conll.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/sinica_treebank.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/ycoe.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/plaintext.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/verbnet.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/senseval.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/timit.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/gutenberg.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/cmudict.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/inference/mace.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/inference/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/inference/discourse.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/inference/inference.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/inference/prover9.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/inference/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chat/suntsu.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chat/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chat/eliza.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chat/zen.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chat/rude.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chat/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chat/iesha.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/browse.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/frequency.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/synset.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/morphy.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/lexname.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/cache.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/brown_ic.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/similarity.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/dictionary.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/wordnet/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/stem/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/stem/lancaster.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/stem/porter.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/stem/wordnet.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/stem/rslp.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/stem/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/stem/regexp.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/sr.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/viterbi.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/featurechart.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/generate.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/pchart.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/rd.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/parse/chart.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tag/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tag/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tag/hmm.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tag/brill.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tag/sequential.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tag/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tokenize/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tokenize/simple.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tokenize/punkt.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tokenize/sexpr.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tokenize/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/tokenize/regexp.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/classify/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/classify/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/classify/decisiontree.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/classify/weka.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/classify/maxent.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/classify/naivebayes.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/classify/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/test/coverage.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/test/doctest_driver.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/test/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/cluster/gaac.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/cluster/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/cluster/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/cluster/kmeans.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/cluster/em.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/cluster/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chunk/api.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chunk/util.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chunk/__init__.py,
/home/peter/clone_digger/nltk-0.9.2/nltk/chunk/regexp.py
Clones detected: 356
Parameters
clustering_threshold = 10
distance_threshold = 5
length_threshold = 30
hashing_depth = 1
clusterize_using_hash = False
Clone # 1
Anti-unification distance between two trees = 4
Total size of two trees = 402
Total length of sequences = 42
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 305 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 274 | |
menubar.add_cascade(label='Apply', underline=0, menu=rulemenu) | menubar.add_cascade(label='Apply', underline=0, menu=rulemenu) | |
viewmenu = Menu(menubar, tearoff=0) | viewmenu = Menu(menubar, tearoff=0) | |
viewmenu.add_checkbutton(label="Show Grammar", underline=0, variable=self._show_grammar, command=self._toggle_grammar) |
viewmenu.add_checkbutton(label="Show Grammar", underline=0, variable=self._show_grammar, command=self._toggle_grammar) |
|
viewmenu.add_separator() | viewmenu.add_separator() | |
viewmenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
viewmenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
|
viewmenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
viewmenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
|
viewmenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
viewmenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
|
viewmenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
viewmenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
|
viewmenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
viewmenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
|
menubar.add_cascade(label='View', underline=0, menu=viewmenu) | menubar.add_cascade(label='View', underline=0, menu=viewmenu) | |
animatemenu = Menu(menubar, tearoff=0) | animatemenu = Menu(menubar, tearoff=0) | |
animatemenu.add_radiobutton(label="No Animation", underline=0, variable=self._animation_frames, value=0) |
animatemenu.add_radiobutton(label="No Animation", underline=0, variable=self._animate, value=0) |
|
animatemenu.add_radiobutton(label="Slow Animation", underline=0, variable=self._animation_frames, value=10, accelerator='-') |
animatemenu.add_radiobutton(label="Slow Animation", underline=0, variable=self._animate, value=20, accelerator='-') |
|
animatemenu.add_radiobutton(label="Normal Animation", underline=0, variable=self._animation_frames, value=5, accelerator='=') |
animatemenu.add_radiobutton(label="Normal Animation", underline=0, variable=self._animate, value=10, accelerator='=') |
|
animatemenu.add_radiobutton(label="Fast Animation", underline=0, variable=self._animation_frames, value=2, accelerator='+') |
animatemenu.add_radiobutton(label="Fast Animation", underline=0, variable=self._animate, value=4, accelerator='+') |
|
menubar.add_cascade(label="Animate", underline=1, menu=animatemenu) | menubar.add_cascade(label="Animate", underline=1, menu=animatemenu) | |
helpmenu = Menu(menubar, tearoff=0) | helpmenu = Menu(menubar, tearoff=0) | |
helpmenu.add_command(label='About', underline=0, command=self.about) |
helpmenu.add_command(label='About', underline=0, command=self.about) |
|
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
|
menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | |
parent.config(menu=menubar) | parent.config(menu=menubar) |
Clone # 2
Anti-unification distance between two trees = 3
Total size of two trees = 234
Total length of sequences = 28
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 274 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 243 | |
menubar = Menu(parent) | menubar = Menu(parent) | |
filemenu = Menu(menubar, tearoff=0) | filemenu = Menu(menubar, tearoff=0) | |
filemenu.add_command(label='Reset Parser', underline=0, command=self.reset, accelerator='Del') |
filemenu.add_command(label='Reset Parser', underline=0, command=self.reset, accelerator='Del') |
|
filemenu.add_command(label='Print to Postscript', underline=0, command=self.postscript, accelerator='Ctrl-p') |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.postscript, accelerator='Ctrl-p') |
|
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) | |
editmenu = Menu(menubar, tearoff=0) | editmenu = Menu(menubar, tearoff=0) | |
editmenu.add_command(label='Edit Grammar', underline=5, command=self.edit_grammar, accelerator='Ctrl-g') |
editmenu.add_command(label='Edit Grammar', underline=5, command=self.edit_grammar, accelerator='Ctrl-g') |
|
editmenu.add_command(label='Edit Text', underline=5, command=self.edit_sentence, accelerator='Ctrl-t') |
editmenu.add_command(label='Edit Text', underline=5, command=self.edit_sentence, accelerator='Ctrl-t') |
|
menubar.add_cascade(label='Edit', underline=0, menu=editmenu) | menubar.add_cascade(label='Edit', underline=0, menu=editmenu) | |
rulemenu = Menu(menubar, tearoff=0) | rulemenu = Menu(menubar, tearoff=0) | |
rulemenu.add_command(label='Step', underline=1, command=self.step, accelerator='Space') |
rulemenu.add_command(label='Step', underline=1, command=self.step, accelerator='Space') |
|
rulemenu.add_separator() | rulemenu.add_separator() | |
rulemenu.add_command(label='Match', underline=0, command=self.match, accelerator='Ctrl-m') |
rulemenu.add_command(label='Shift', underline=0, command=self.shift, accelerator='Ctrl-s') |
Clone # 3
Anti-unification distance between two trees = 1
Total size of two trees = 176
Total length of sequences = 28
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/tag/hmm.py" The first line is 1007 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/tag/hmm.py" The first line is 860 | |
print "Baum-Welch demo for market example" | print "HMM probability calculation demo" | |
symbols = ['up', 'down', 'unchanged'] | symbols = ['up', 'down', 'unchanged'] | |
states = ['bull', 'bear', 'static'] | states = ['bull', 'bear', 'static'] | |
def pd(values, samples): d = {} for value, item in zip(values, samples): d[item] = value return DictionaryProbDist(d) |
def pd(values, samples): d = {} for value, item in zip(values, samples): d[item] = value return DictionaryProbDist(d) |
|
def cpd(array, conditions, samples): d = {} for values, condition in zip(array, conditions): d[condition] = pd(values, samples) return DictionaryConditionalProbDist(d) |
def cpd(array, conditions, samples): d = {} for values, condition in zip(array, conditions): d[condition] = pd(values, samples) return DictionaryConditionalProbDist(d) |
|
A = array([[0.6, 0.2, 0.2], [0.5, 0.3, 0.2], [0.4, 0.1, 0.5]], float64) | A = array([[0.6, 0.2, 0.2], [0.5, 0.3, 0.2], [0.4, 0.1, 0.5]], float64) | |
A = cpd(A, states, states) | A = cpd(A, states, states) | |
B = array([[0.7, 0.1, 0.2], [0.1, 0.6, 0.3], [0.3, 0.3, 0.4]], float64) | B = array([[0.7, 0.1, 0.2], [0.1, 0.6, 0.3], [0.3, 0.3, 0.4]], float64) | |
B = cpd(B, states, symbols) | B = cpd(B, states, symbols) | |
pi = array([0.5, 0.2, 0.3], float64) | pi = array([0.5, 0.2, 0.3], float64) | |
pi = pd(pi, states) | pi = pd(pi, states) | |
model = HiddenMarkovModelTagger(symbols=symbols, states=states, transitions=A, outputs=B, priors=pi) |
model = HiddenMarkovModelTagger(symbols=symbols, states=states, transitions=A, outputs=B, priors=pi) |
Clone # 4
Anti-unification distance between two trees = 4
Total size of two trees = 159
Total length of sequences = 14
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/tree.py" The first line is 820 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1918 | |
zoommenu = Menu(menubar, tearoff=0) | zoommenu = Tkinter.Menu(menubar, tearoff=0) | |
zoommenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
zoommenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
|
zoommenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
zoommenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
|
zoommenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
zoommenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
|
zoommenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=28, command=self.resize) |
zoommenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
|
zoommenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=50, command=self.resize) |
zoommenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
|
menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu) | menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu) |
Clone # 5
Anti-unification distance between two trees = 2
Total size of two trees = 156
Total length of sequences = 18
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 151 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 155 | |
self._prodframe = listframe = Frame(parent) | self._prodframe = listframe = Frame(parent) | |
self._prodframe.pack(fill='both', side='left', padx=2) | self._prodframe.pack(fill='both', side='left', padx=2) | |
self._prodlist_label = Label(self._prodframe, font=self._boldfont, text='Available Expansions') |
self._prodlist_label = Label(self._prodframe, font=self._boldfont, text='Available Reductions') |
|
self._prodlist_label.pack() | self._prodlist_label.pack() | |
self._prodlist = Listbox(self._prodframe, selectmode='single', relief='groove', background='white', foreground='#909090', font=self._font, selectforeground='#004040', selectbackground='#c0f0c0') |
self._prodlist = Listbox(self._prodframe, selectmode='single', relief='groove', background='white', foreground='#909090', font=self._font, selectforeground='#004040', selectbackground='#c0f0c0') |
|
self._prodlist.pack(side='right', fill='both', expand=1) | self._prodlist.pack(side='right', fill='both', expand=1) | |
self._productions = list(self._parser.grammar().productions()) | self._productions = list(self._parser.grammar().productions()) | |
for production in self._productions: self._prodlist.insert('end', (' %s' % production)) |
for production in self._productions: self._prodlist.insert('end', (' %s' % production)) |
|
self._prodlist.config(height=min(len(self._productions), 25)) | self._prodlist.config(height=min(len(self._productions), 25)) |
Clone # 6
Anti-unification distance between two trees = 2
Total size of two trees = 146
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1919 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 312 | |
zoommenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
viewmenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
|
zoommenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
viewmenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
|
zoommenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
viewmenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
|
zoommenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
viewmenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
|
zoommenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
viewmenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
|
menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu) | menubar.add_cascade(label='View', underline=0, menu=viewmenu) |
Clone # 7
Anti-unification distance between two trees = 2
Total size of two trees = 146
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1919 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 281 | |
zoommenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
viewmenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
|
zoommenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
viewmenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
|
zoommenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
viewmenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
|
zoommenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
viewmenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
|
zoommenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
viewmenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
|
menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu) | menubar.add_cascade(label='View', underline=0, menu=viewmenu) |
Clone # 8
Anti-unification distance between two trees = 4
Total size of two trees = 146
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/tree.py" The first line is 821 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 312 | |
zoommenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
viewmenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
|
zoommenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
viewmenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
|
zoommenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
viewmenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
|
zoommenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=28, command=self.resize) |
viewmenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
|
zoommenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=50, command=self.resize) |
viewmenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
|
menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu) | menubar.add_cascade(label='View', underline=0, menu=viewmenu) |
Clone # 9
Anti-unification distance between two trees = 4
Total size of two trees = 146
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/tree.py" The first line is 821 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 281 | |
zoommenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
viewmenu.add_radiobutton(label='Tiny', variable=self._size, underline=0, value=10, command=self.resize) |
|
zoommenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
viewmenu.add_radiobutton(label='Small', variable=self._size, underline=0, value=12, command=self.resize) |
|
zoommenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
viewmenu.add_radiobutton(label='Medium', variable=self._size, underline=0, value=14, command=self.resize) |
|
zoommenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=28, command=self.resize) |
viewmenu.add_radiobutton(label='Large', variable=self._size, underline=0, value=18, command=self.resize) |
|
zoommenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=50, command=self.resize) |
viewmenu.add_radiobutton(label='Huge', variable=self._size, underline=0, value=24, command=self.resize) |
|
menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu) | menubar.add_cascade(label='View', underline=0, menu=viewmenu) |
Clone # 10
Anti-unification distance between two trees = 4
Total size of two trees = 146
Total length of sequences = 18
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 605 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 585 | |
cv2_frame = Tkinter.Frame(frame, border=3, relief='groove') | cv1_frame = Tkinter.Frame(frame, border=3, relief='groove') | |
cv2_frame.pack(side='left', padx=8, pady=7, expand=1, fill='both') | cv1_frame.pack(side='left', padx=8, pady=7, expand=1, fill='both') | |
self._right_selector = MutableOptionMenu( cv2_frame, self._charts.keys(), command=self._select_right) |
self._left_selector = MutableOptionMenu( cv1_frame, self._charts.keys(), command=self._select_left) |
|
self._right_selector.pack(side='top', pady=5, fill='x') | self._left_selector.pack(side='top', pady=5, fill='x') | |
self._right_matrix = ChartMatrixView(cv2_frame, self._emptychart, toplevel=False, show_numedges=True) |
self._left_matrix = ChartMatrixView(cv1_frame, self._emptychart, toplevel=False, show_numedges=True) |
|
self._right_matrix.pack(side='bottom', padx=5, pady=5, expand=1, fill='both') |
self._left_matrix.pack(side='bottom', padx=5, pady=5, expand=1, fill='both') |
|
self._right_matrix.add_callback('select', self.select_edge) | self._left_matrix.add_callback('select', self.select_edge) | |
self._right_matrix.add_callback('select_cell', self.select_cell) | self._left_matrix.add_callback('select_cell', self.select_cell) | |
self._right_matrix.inactivate() | self._left_matrix.inactivate() |
Clone # 11
Anti-unification distance between two trees = 4
Total size of two trees = 130
Total length of sequences = 26
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 473 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 471 | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) or (not (man x)))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) or (not (man x)))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) iff (man x))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 12
Anti-unification distance between two trees = 3
Total size of two trees = 120
Total length of sequences = 24
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 476 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 470 | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'((man x) implies (not (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) or (not (man x)))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) iff (man x))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'(not ((man x) iff (not (man x))))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 13
Anti-unification distance between two trees = 4
Total size of two trees = 118
Total length of sequences = 14
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/classify/api.py" The first line is 118 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/classify/api.py" The first line is 47 | |
def labels(self): raise NotImplementedError() |
def labels(self): raise NotImplementedError() |
|
def classify(self, featureset): if overridden(self.batch_classify): return self.batch_classify([featureset])[0] raise NotImplementedError() |
def classify(self, featureset): if overridden(self.batch_classify): return self.batch_classify([featureset])[0] raise NotImplementedError() |
|
def prob_classify(self, featureset): if overridden(self.batch_prob_classify): return self.batch_prob_classify([featureset])[0] raise NotImplementedError() |
def prob_classify(self, featureset): if overridden(self.batch_prob_classify): return self.batch_prob_classify([featureset])[0] raise NotImplementedError() |
|
def batch_classify(self, featuresets): return [self.classify(fs) for fs in featuresets] |
def batch_classify(self, featuresets): return [self.classify(fs) for fs in featuresets] |
|
def batch_prob_classify(self, featuresets): return [self.prob_classify(fs) for fs in featuresets] |
def batch_prob_classify(self, featuresets): return [self.prob_classify(fs) for fs in featuresets] |
|
@deprecated("Use .batch_prob_classify() instead.") def batch_probdist(self, featuresets): return self.batch_prob_classify(featuresets) |
@deprecated("Use .batch_prob_classify() instead.") def batch_probdist(self, featuresets): return self.batch_prob_classify(featuresets) |
|
@deprecated("Use .prob_classify() instead.") def probdist(self, featureset): return self.prob_classify(featureset) |
@deprecated("Use .prob_classify() instead.") def probdist(self, featureset): return self.prob_classify(featureset) |
Clone # 14
Anti-unification distance between two trees = 3
Total size of two trees = 116
Total length of sequences = 8
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/__init__.py" The first line is 1366 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/__init__.py" The first line is 1209 | |
def __init__(self, canvas, *children, **attribs): self._align = 'center' self._space = 1 self._ordered = False self._children = list(children) for child in children: self._add_child_widget(child) CanvasWidget.__init__(self, canvas, **attribs) |
def __init__(self, canvas, *children, **attribs): self._align = 'center' self._space = 1 self._ordered = False self._children = list(children) for child in children: self._add_child_widget(child) CanvasWidget.__init__(self, canvas, **attribs) |
|
def __setitem__(self, attr, value): if attr == 'align': if value not in ('left', 'right', 'center'): raise ValueError('Bad alignment: %r' % value) self._align = value elif attr == 'space': self._space = value elif attr == 'ordered': self._ordered = value else: CanvasWidget.__setitem__(self, attr, value) |
def __setitem__(self, attr, value): if attr == 'align': if value not in ('top', 'bottom', 'center'): raise ValueError('Bad alignment: %r' % value) self._align = value elif attr == 'space': self._space = value elif attr == 'ordered': self._ordered = value else: CanvasWidget.__setitem__(self, attr, value) |
|
def __getitem__(self, attr): if attr == 'align': return value elif attr == 'space': return self._space elif attr == 'ordered': return self._ordered else: return CanvasWidget.__getitem__(self, attr) |
def __getitem__(self, attr): if attr == 'align': return value elif attr == 'space': return self._space elif attr == 'ordered': return self._ordered else: return CanvasWidget.__getitem__(self, attr) |
|
def _tags(self): return [] | def _tags(self): return [] |
Clone # 15
Anti-unification distance between two trees = 4
Total size of two trees = 114
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 325 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1905 | |
animatemenu.add_radiobutton(label="No Animation", underline=0, variable=self._animation_frames, value=0) |
animatemenu.add_radiobutton(label="No Animation", underline=0, variable=self._animate, value=0) |
|
animatemenu.add_radiobutton(label="Slow Animation", underline=0, variable=self._animation_frames, value=10, accelerator='-') |
animatemenu.add_radiobutton(label="Slow Animation", underline=0, variable=self._animate, value=1, accelerator='-') |
|
animatemenu.add_radiobutton(label="Normal Animation", underline=0, variable=self._animation_frames, value=5, accelerator='=') |
animatemenu.add_radiobutton(label="Normal Animation", underline=0, variable=self._animate, value=2, accelerator='=') |
|
animatemenu.add_radiobutton(label="Fast Animation", underline=0, variable=self._animation_frames, value=2, accelerator='+') |
animatemenu.add_radiobutton(label="Fast Animation", underline=0, variable=self._animate, value=3, accelerator='+') |
|
menubar.add_cascade(label="Animate", underline=1, menu=animatemenu) | menubar.add_cascade(label="Animate", underline=1, menu=animatemenu) |
Clone # 16
Anti-unification distance between two trees = 3
Total size of two trees = 114
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 294 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1905 | |
animatemenu.add_radiobutton(label="No Animation", underline=0, variable=self._animate, value=0) |
animatemenu.add_radiobutton(label="No Animation", underline=0, variable=self._animate, value=0) |
|
animatemenu.add_radiobutton(label="Slow Animation", underline=0, variable=self._animate, value=20, accelerator='-') |
animatemenu.add_radiobutton(label="Slow Animation", underline=0, variable=self._animate, value=1, accelerator='-') |
|
animatemenu.add_radiobutton(label="Normal Animation", underline=0, variable=self._animate, value=10, accelerator='=') |
animatemenu.add_radiobutton(label="Normal Animation", underline=0, variable=self._animate, value=2, accelerator='=') |
|
animatemenu.add_radiobutton(label="Fast Animation", underline=0, variable=self._animate, value=4, accelerator='+') |
animatemenu.add_radiobutton(label="Fast Animation", underline=0, variable=self._animate, value=3, accelerator='+') |
|
menubar.add_cascade(label="Animate", underline=1, menu=animatemenu) | menubar.add_cascade(label="Animate", underline=1, menu=animatemenu) |
Clone # 17
Anti-unification distance between two trees = 2
Total size of two trees = 111
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1855 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 281 | |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) | |
editmenu = Tkinter.Menu(menubar, tearoff=0) | editmenu = Menu(menubar, tearoff=0) | |
editmenu.add_command(label='Edit Grammar', underline=5, command=self.edit_grammar, accelerator='Ctrl-g') |
editmenu.add_command(label='Edit Grammar', underline=5, command=self.edit_grammar, accelerator='Ctrl-g') |
|
editmenu.add_command(label='Edit Text', underline=5, command=self.edit_sentence, accelerator='Ctrl-t') |
editmenu.add_command(label='Edit Text', underline=5, command=self.edit_sentence, accelerator='Ctrl-t') |
|
menubar.add_cascade(label='Edit', underline=0, menu=editmenu) | menubar.add_cascade(label='Edit', underline=0, menu=editmenu) |
Clone # 18
Anti-unification distance between two trees = 2
Total size of two trees = 111
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1855 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 250 | |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) | |
editmenu = Tkinter.Menu(menubar, tearoff=0) | editmenu = Menu(menubar, tearoff=0) | |
editmenu.add_command(label='Edit Grammar', underline=5, command=self.edit_grammar, accelerator='Ctrl-g') |
editmenu.add_command(label='Edit Grammar', underline=5, command=self.edit_grammar, accelerator='Ctrl-g') |
|
editmenu.add_command(label='Edit Text', underline=5, command=self.edit_sentence, accelerator='Ctrl-t') |
editmenu.add_command(label='Edit Text', underline=5, command=self.edit_sentence, accelerator='Ctrl-t') |
|
menubar.add_cascade(label='Edit', underline=0, menu=editmenu) | menubar.add_cascade(label='Edit', underline=0, menu=editmenu) |
Clone # 19
Anti-unification distance between two trees = 2
Total size of two trees = 110
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/plaintext.py" The first line is 140 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/tagged.py" The first line is 169 | |
def __init__(self, *args, **kwargs): CategorizedCorpusReader.__init__(self, kwargs) PlaintextCorpusReader.__init__(self, *args, **kwargs) |
def __init__(self, *args, **kwargs): CategorizedCorpusReader.__init__(self, kwargs) TaggedCorpusReader.__init__(self, *args, **kwargs) |
|
def _resolve(self, files, categories): if files is not None and categories is not None: raise ValueError('Specify files or categories, not both') if categories is not None: return self.files(categories) return files |
def _resolve(self, files, categories): if files is not None and categories is not None: raise ValueError('Specify files or categories, not both') if categories is not None: return self.files(categories) return files |
|
def raw(self, files=None, categories=None): return PlaintextCorpusReader.raw( self, self._resolve(files, categories)) |
def raw(self, files=None, categories=None): return TaggedCorpusReader.raw( self, self._resolve(files, categories)) |
|
def words(self, files=None, categories=None): return PlaintextCorpusReader.words( self, self._resolve(files, categories)) |
def words(self, files=None, categories=None): return TaggedCorpusReader.words( self, self._resolve(files, categories)) |
|
def sents(self, files=None, categories=None): return PlaintextCorpusReader.sents( self, self._resolve(files, categories)) |
def sents(self, files=None, categories=None): return TaggedCorpusReader.sents( self, self._resolve(files, categories)) |
|
def paras(self, files=None, categories=None): return PlaintextCorpusReader.paras( self, self._resolve(files, categories)) |
def paras(self, files=None, categories=None): return TaggedCorpusReader.paras( self, self._resolve(files, categories)) |
Clone # 20
Anti-unification distance between two trees = 4
Total size of two trees = 110
Total length of sequences = 22
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 475 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 471 | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) or (not (man x)))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) iff (man x))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 21
Anti-unification distance between two trees = 1
Total size of two trees = 102
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/__init__.py" The first line is 1455 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/__init__.py" The first line is 1298 | |
def __repr__(self): return '[Stack: ' + `self._children`[1:-1]+']' |
def __repr__(self): return '[Sequence: ' + `self._children`[1:-1]+']' |
|
children = CanvasWidget.child_widgets | children = CanvasWidget.child_widgets | |
def replace_child(self, oldchild, newchild): index = self._children.index(oldchild) self._children[index] = newchild self._remove_child_widget(oldchild) self._add_child_widget(newchild) self.update(newchild) |
def replace_child(self, oldchild, newchild): index = self._children.index(oldchild) self._children[index] = newchild self._remove_child_widget(oldchild) self._add_child_widget(newchild) self.update(newchild) |
|
def remove_child(self, child): index = self._children.index(child) del self._children[index] self._remove_child_widget(child) if len(self._children) > 0: self.update(self._children[0]) |
def remove_child(self, child): index = self._children.index(child) del self._children[index] self._remove_child_widget(child) if len(self._children) > 0: self.update(self._children[0]) |
|
def insert_child(self, index, child): self._children.insert(index, child) self._add_child_widget(child) |
def insert_child(self, index, child): self._children.insert(index, child) self._add_child_widget(child) |
Clone # 22
Anti-unification distance between two trees = 1
Total size of two trees = 100
Total length of sequences = 8
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 846 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 560 | |
def edit_grammar(self, *e): CFGEditor(self._top, self._parser.grammar(), self.set_grammar) |
def edit_grammar(self, *e): CFGEditor(self._top, self._parser.grammar(), self.set_grammar) |
|
def set_grammar(self, grammar): self._parser.set_grammar(grammar) self._productions = list(grammar.productions()) self._prodlist.delete(0, 'end') for production in self._productions: self._prodlist.insert('end', (' %s' % production)) |
def set_grammar(self, grammar): self._parser.set_grammar(grammar) self._productions = list(grammar.productions()) self._prodlist.delete(0, 'end') for production in self._productions: self._prodlist.insert('end', (' %s' % production)) |
|
def edit_sentence(self, *e): sentence = string.join(self._sent) title = 'Edit Text' instr = 'Enter a new sentence to parse.' EntryDialog(self._top, sentence, instr, self.set_sentence, title) |
def edit_sentence(self, *e): sentence = string.join(self._sent) title = 'Edit Text' instr = 'Enter a new sentence to parse.' EntryDialog(self._top, sentence, instr, self.set_sentence, title) |
|
def set_sentence(self, sentence): self._sent = sentence.split() #[XX] use tagged? self.reset() |
def set_sentence(self, sentence): self._sent = sent.split() #[XX] use tagged? self.reset() |
Clone # 23
Anti-unification distance between two trees = 0
Total size of two trees = 98
Total length of sequences = 14
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/tag/hmm.py" The first line is 450 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/tag/hmm.py" The first line is 487 | |
T = len(unlabeled_sequence) | T = len(unlabeled_sequence) | |
N = len(self._states) | N = len(self._states) | |
labellings = [[state] for state in self._states] | labellings = [[state] for state in self._states] | |
for t in range(T - 1): current = labellings labellings = [] for labelling in current: for state in self._states: labellings.append(labelling + [state]) |
for t in range(T - 1): current = labellings labellings = [] for labelling in current: for state in self._states: labellings.append(labelling + [state]) |
|
log_probs = [] | log_probs = [] | |
for labelling in labellings: labelled_sequence = unlabeled_sequence[:] for t, label in enumerate(labelling): labelled_sequence[t] = (labelled_sequence[t][_TEXT], label) lp = self.log_probability(labelled_sequence) log_probs.append(lp) |
for labelling in labellings: labelled_sequence = unlabeled_sequence[:] for t, label in enumerate(labelling): labelled_sequence[t] = (labelled_sequence[t][_TEXT], label) lp = self.log_probability(labelled_sequence) log_probs.append(lp) |
|
normalisation = _log_add(*log_probs) | normalisation = _log_add(*log_probs) |
Clone # 24
Anti-unification distance between two trees = 4
Total size of two trees = 95
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1929 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 630 | |
menubar.add_cascade(label='Zoom', underline=0, menu=zoommenu) | menubar.add_cascade(label='Axes', underline=0, menu=axismenu) | |
helpmenu = Tkinter.Menu(menubar, tearoff=0) | helpmenu = Tkinter.Menu(menubar, tearoff=0) | |
helpmenu.add_command(label='About', underline=0, command=self.about) |
helpmenu.add_command(label='About', underline=0, command=self.about) |
|
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
|
menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | |
self._root.config(menu=menubar) | parent.config(menu=menubar) |
Clone # 25
Anti-unification distance between two trees = 4
Total size of two trees = 94
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1721 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 133 | |
self._sysfont = tkFont.Font(font=Tkinter.Button()["font"]) | self._sysfont = tkFont.Font(font=Button()["font"]) | |
root.option_add("*Font", self._sysfont) | root.option_add("*Font", self._sysfont) | |
self._size = Tkinter.IntVar(root) | self._size = IntVar(root) | |
self._size.set(self._sysfont.cget('size')) | self._size.set(self._sysfont.cget('size')) | |
self._boldfont = tkFont.Font(family='helvetica', weight='bold', size=self._size.get()) |
self._boldfont = tkFont.Font(family='helvetica', weight='bold', size=self._size.get()) |
|
self._font = tkFont.Font(family='helvetica', size=self._size.get()) |
self._font = tkFont.Font(family='helvetica', size=self._size.get()) |
Clone # 26
Anti-unification distance between two trees = 0
Total size of two trees = 92
Total length of sequences = 12
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 141 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 133 | |
self._sysfont = tkFont.Font(font=Button()["font"]) | self._sysfont = tkFont.Font(font=Button()["font"]) | |
root.option_add("*Font", self._sysfont) | root.option_add("*Font", self._sysfont) | |
self._size = IntVar(root) | self._size = IntVar(root) | |
self._size.set(self._sysfont.cget('size')) | self._size.set(self._sysfont.cget('size')) | |
self._boldfont = tkFont.Font(family='helvetica', weight='bold', size=self._size.get()) |
self._boldfont = tkFont.Font(family='helvetica', weight='bold', size=self._size.get()) |
|
self._font = tkFont.Font(family='helvetica', size=self._size.get()) |
self._font = tkFont.Font(family='helvetica', size=self._size.get()) |
Clone # 27
Anti-unification distance between two trees = 4
Total size of two trees = 90
Total length of sequences = 18
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 479 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 471 | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) or (not (man x)))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) iff (man x))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'(not ((man x) iff (not (man x))))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 28
Anti-unification distance between two trees = 4
Total size of two trees = 88
Total length of sequences = 2
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/tree.py" The first line is 518 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/tree.py" The first line is 484 | |
class ImmutableProbabilisticTree(ImmutableTree, ProbabilisticMixIn): def __init__(self, node, children, **prob_kwargs): ProbabilisticMixIn.__init__(self, **prob_kwargs) ImmutableTree.__init__(self, node, children) def _frozen_class(self): return ImmutableProbabilisticTree def __repr__(self): return '%s [%s]' % (Tree.__repr__(self), self.prob()) def __str__(self): return '%s [%s]' % (self.pprint(margin=60), self.prob()) def __cmp__(self, other): c = Tree.__cmp__(self, other) if c != 0: return c return cmp(self.prob(), other.prob()) def __eq__(self, other): if not isinstance(other, Tree): return False return Tree.__eq__(self, other) and self.prob()==other.prob() def __ne__(self, other): return not (self == other) def copy(self, deep=False): if not deep: return self.__class__(self.node, self, prob=self.prob()) else: return self.__class__.convert(self) def convert(cls, val): if isinstance(val, Tree): children = [cls.convert(child) for child in val] if isinstance(val, ProbabilisticMixIn): return cls(val.node, children, prob=val.prob()) return cls(val.node, children, prob=1) return val convert = classmethod(convert) |
class ProbabilisticTree(Tree, ProbabilisticMixIn): def __init__(self, node, children, **prob_kwargs): ProbabilisticMixIn.__init__(self, **prob_kwargs) Tree.__init__(self, node, children) def _frozen_class(self): return ImmutableProbabilisticTree def __repr__(self): return '%s (p=%s)' % (Tree.__repr__(self), self.prob()) def __str__(self): return '%s (p=%s)' % (self.pprint(margin=60), self.prob()) def __cmp__(self, other): c = Tree.__cmp__(self, other) if c != 0: return c return cmp(self.prob(), other.prob()) def __eq__(self, other): if not isinstance(other, Tree): return False return Tree.__eq__(self, other) and self.prob()==other.prob() def __ne__(self, other): return not (self == other) def copy(self, deep=False): if not deep: return self.__class__(self.node, self, prob=self.prob()) else: return self.__class__.convert(self) def convert(cls, val): if isinstance(val, Tree): children = [cls.convert(child) for child in val] if isinstance(val, ProbabilisticMixIn): return cls(val.node, children, prob=val.prob()) return cls(val.node, children, prob=1.0) return val convert = classmethod(convert) |
Clone # 29
Anti-unification distance between two trees = 4
Total size of two trees = 88
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/parse/viterbi.py" The first line is 345 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/parse/pchart.py" The first line is 389 | |
from nltk import tokenize | from nltk import tokenize, cfg | |
from nltk.parse import ViterbiParser | from nltk.parse import pchart | |
demos = [('I saw the man with my telescope', nltk.toy_pcfg1), ('the boy saw Jack with Bob under the table with a telescope', nltk.toy_pcfg2)] |
demos = [('I saw John with my telescope', cfg.toy_pcfg1), ('the boy saw Jack with Bob under the table with a telescope', cfg.toy_pcfg2)] |
|
for i in range(len(demos)): print '%3s: %s' % (i+1, demos[i][0]) print ' %r' % demos[i][1] |
for i in range(len(demos)): print '%3s: %s' % (i+1, demos[i][0]) print ' %r' % demos[i][1] |
|
print 'Which demo (%d-%d)? ' % (1, len(demos)), | print 'Which demo (%d-%d)? ' % (1, len(demos)), | |
try: snum = int(sys.stdin.readline().strip())-1 sent, grammar = demos[snum] print 'Bad sentence number' return |
try: snum = int(sys.stdin.readline().strip())-1 sent, grammar = demos[snum] print 'Bad sentence number' return |
|
tokens = sent.split() | tokens = sent.split() |
Clone # 30
Anti-unification distance between two trees = 0
Total size of two trees = 86
Total length of sequences = 2
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 244 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 317 | |
def _init_feedback(self, parent): self._feedbackframe = feedbackframe = Frame(parent) feedbackframe.pack(fill='x', side='bottom', padx=3, pady=3) self._lastoper_label = Label(feedbackframe, text='Last Operation:', font=self._font) self._lastoper_label.pack(side='left') lastoperframe = Frame(feedbackframe, relief='sunken', border=1) lastoperframe.pack(fill='x', side='right', expand=1, padx=5) self._lastoper1 = Label(lastoperframe, foreground='#007070', background='#f0f0f0', font=self._font) self._lastoper2 = Label(lastoperframe, anchor='w', width=30, foreground='#004040', background='#f0f0f0', font=self._font) self._lastoper1.pack(side='left') self._lastoper2.pack(side='left', fill='x', expand=1) |
def _init_feedback(self, parent): self._feedbackframe = feedbackframe = Frame(parent) feedbackframe.pack(fill='x', side='bottom', padx=3, pady=3) self._lastoper_label = Label(feedbackframe, text='Last Operation:', font=self._font) self._lastoper_label.pack(side='left') lastoperframe = Frame(feedbackframe, relief='sunken', border=1) lastoperframe.pack(fill='x', side='right', expand=1, padx=5) self._lastoper1 = Label(lastoperframe, foreground='#007070', background='#f0f0f0', font=self._font) self._lastoper2 = Label(lastoperframe, anchor='w', width=30, foreground='#004040', background='#f0f0f0', font=self._font) self._lastoper1.pack(side='left') self._lastoper2.pack(side='left', fill='x', expand=1) |
Clone # 31
Anti-unification distance between two trees = 3
Total size of two trees = 83
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/__init__.py" The first line is 1698 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/tree.py" The first line is 810 | |
menubar = Menu(self._parent) | menubar = Menu(self._top) | |
filemenu = Menu(menubar, tearoff=0) | filemenu = Menu(menubar, tearoff=0) | |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.print_to_file, accelerator='Ctrl-p') |
filemenu.add_command(label='Print to Postscript', underline=0, command=self._cframe.print_to_file, accelerator='Ctrl-p') |
|
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) |
Clone # 32
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 480 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 504 | |
f = LogicParser().parse(r'((man x) or (not (man x)))') | f = LogicParser().parse('all x.all y.((x = y) implies (y = x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse('all x.all y.all z.(((x = y)and(y = z))implies(x = z))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) iff (man x))') | f = LogicParser().parse('(not(all x.some y.(F y x) and some x.all y.(not(F y x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'(not ((man x) iff (not (man x))))') | f = LogicParser().parse('some x.all y.(sees x y)') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 33
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 504 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 478 | |
f = LogicParser().parse('all x.all y.((x = y) implies (y = x))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('all x.all y.all z.(((x = y)and(y = z))implies(x = z))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('(not(all x.some y.(F y x) and some x.all y.(not(F y x))))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('some x.all y.(sees x y)') | f = LogicParser().parse(r'((man x) iff (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 34
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 504 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 476 | |
f = LogicParser().parse('all x.all y.((x = y) implies (y = x))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('all x.all y.all z.(((x = y)and(y = z))implies(x = z))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('(not(all x.some y.(F y x) and some x.all y.(not(F y x))))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('some x.all y.(sees x y)') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 35
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 504 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 474 | |
f = LogicParser().parse('all x.all y.((x = y) implies (y = x))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('all x.all y.all z.(((x = y)and(y = z))implies(x = z))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('(not(all x.some y.(F y x) and some x.all y.(not(F y x))))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('some x.all y.(sees x y)') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 36
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 504 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 472 | |
f = LogicParser().parse('all x.all y.((x = y) implies (y = x))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('all x.all y.all z.(((x = y)and(y = z))implies(x = z))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('(not(all x.some y.(F y x) and some x.all y.(not(F y x))))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('some x.all y.(sees x y)') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 37
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 504 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 470 | |
f = LogicParser().parse('all x.all y.((x = y) implies (y = x))') | f = LogicParser().parse(r'((man x) implies (not (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('all x.all y.all z.(((x = y)and(y = z))implies(x = z))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('(not(all x.some y.(F y x) and some x.all y.(not(F y x))))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse('some x.all y.(sees x y)') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 38
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 16
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 480 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/inference/tableau.py" The first line is 470 | |
f = LogicParser().parse(r'((man x) or (not (man x)))') | f = LogicParser().parse(r'((man x) implies (not (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) implies (man x))') | f = LogicParser().parse(r'(not ((man x) and (not (man x))))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'((man x) iff (man x))') | f = LogicParser().parse(r'((man x) or (not (man x)))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | |
f = LogicParser().parse(r'(not ((man x) iff (not (man x))))') | f = LogicParser().parse(r'((man x) implies (man x))') | |
print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) | print '|- %s: %s' % (f.infixify(), Tableau(f).prove()) |
Clone # 39
Anti-unification distance between two trees = 4
Total size of two trees = 80
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 217 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1828 | |
self._top.bind(' |
self._root.bind(' |
|
self._top.bind(' |
self._root.bind(' |
|
self._top.bind('-', lambda e,a=self._animate:a.set(20)) | self._root.bind('-', lambda e,a=self._animate:a.set(1)) | |
self._top.bind('=', lambda e,a=self._animate:a.set(10)) | self._root.bind('=', lambda e,a=self._animate:a.set(2)) | |
self._top.bind('+', lambda e,a=self._animate:a.set(4)) | self._root.bind('+', lambda e,a=self._animate:a.set(3)) |
Clone # 40
Anti-unification distance between two trees = 4
Total size of two trees = 78
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1931 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 340 | |
helpmenu = Tkinter.Menu(menubar, tearoff=0) | helpmenu = Menu(menubar, tearoff=0) | |
helpmenu.add_command(label='About', underline=0, command=self.about) |
helpmenu.add_command(label='About', underline=0, command=self.about) |
|
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
|
menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | |
self._root.config(menu=menubar) | parent.config(menu=menubar) |
Clone # 41
Anti-unification distance between two trees = 4
Total size of two trees = 78
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1931 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 308 | |
helpmenu = Tkinter.Menu(menubar, tearoff=0) | helpmenu = Menu(menubar, tearoff=0) | |
helpmenu.add_command(label='About', underline=0, command=self.about) |
helpmenu.add_command(label='About', underline=0, command=self.about) |
|
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
|
menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | |
self._root.config(menu=menubar) | parent.config(menu=menubar) |
Clone # 42
Anti-unification distance between two trees = 2
Total size of two trees = 77
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 632 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 340 | |
helpmenu = Tkinter.Menu(menubar, tearoff=0) | helpmenu = Menu(menubar, tearoff=0) | |
helpmenu.add_command(label='About', underline=0, command=self.about) |
helpmenu.add_command(label='About', underline=0, command=self.about) |
|
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
|
menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | |
parent.config(menu=menubar) | parent.config(menu=menubar) |
Clone # 43
Anti-unification distance between two trees = 2
Total size of two trees = 77
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 632 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 308 | |
helpmenu = Tkinter.Menu(menubar, tearoff=0) | helpmenu = Menu(menubar, tearoff=0) | |
helpmenu.add_command(label='About', underline=0, command=self.about) |
helpmenu.add_command(label='About', underline=0, command=self.about) |
|
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
helpmenu.add_command(label='Instructions', underline=0, command=self.help, accelerator='F1') |
|
menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | menubar.add_cascade(label='Help', underline=0, menu=helpmenu) | |
parent.config(menu=menubar) | parent.config(menu=menubar) |
Clone # 44
Anti-unification distance between two trees = 4
Total size of two trees = 76
Total length of sequences = 6
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1800 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1792 | |
Tkinter.Button(frame2, text='Bottom Up Init\nRule', background='#90f090', foreground='black', command=self.bottom_up_init).pack(side='left') |
Tkinter.Button(frame2, text='Top Down Expand\nRule', background='#90f090', foreground='black', command=self.top_down_expand).pack(side='left') |
|
Tkinter.Button(frame2, text='Bottom Up Predict\nRule', background='#90f090', foreground='black', command=self.bottom_up).pack(side='left') |
Tkinter.Button(frame2, text='Top Down Match\nRule', background='#90f090', foreground='black', command=self.top_down_match).pack(side='left') |
|
Tkinter.Frame(frame2, width=20).pack(side='left') | Tkinter.Frame(frame2, width=20).pack(side='left') |
Clone # 45
Anti-unification distance between two trees = 4
Total size of two trees = 74
Total length of sequences = 8
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 606 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/chart.py" The first line is 1855 | |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) | |
zoommenu = Tkinter.Menu(menubar, tearoff=0) | editmenu = Tkinter.Menu(menubar, tearoff=0) | |
zoommenu.add_command(label='Zoom in', underline=5, command=self._zoom_in, accelerator='left click') |
editmenu.add_command(label='Edit Grammar', underline=5, command=self.edit_grammar, accelerator='Ctrl-g') |
Clone # 46
Anti-unification distance between two trees = 2
Total size of two trees = 74
Total length of sequences = 10
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 122 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 339 | |
sb1 = Tkinter.Scrollbar(self._frame, orient='vertical') | sb1 = Tkinter.Scrollbar(self._frame, orient='vertical') | |
sb1.pack(side='right', fill='y') | sb1.pack(side='right', fill='y') | |
sb2 = Tkinter.Scrollbar(self._frame, orient='horizontal') | sb2 = Tkinter.Scrollbar(self._frame, orient='horizontal') | |
sb2.pack(side='bottom', fill='x') | sb2.pack(side='bottom', fill='x') | |
self._canvas.pack(side='left', fill='both', expand=1) | self._graph.pack(side='left', fill='both', expand='yes') |
Clone # 47
Anti-unification distance between two trees = 3
Total size of two trees = 73
Total length of sequences = 8
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/__init__.py" The first line is 1700 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 603 | |
filemenu = Menu(menubar, tearoff=0) | filemenu = Tkinter.Menu(menubar, tearoff=0) | |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.print_to_file, accelerator='Ctrl-p') |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.postscript, accelerator='Ctrl-p') |
|
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) |
Clone # 48
Anti-unification distance between two trees = 3
Total size of two trees = 73
Total length of sequences = 8
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 604 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/rdparser.py" The first line is 279 | |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.postscript, accelerator='Ctrl-p') |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.postscript, accelerator='Ctrl-p') |
|
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) | |
zoommenu = Tkinter.Menu(menubar, tearoff=0) | editmenu = Menu(menubar, tearoff=0) |
Clone # 49
Anti-unification distance between two trees = 3
Total size of two trees = 73
Total length of sequences = 8
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/plot.py" The first line is 604 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/draw/srparser.py" The first line is 248 | |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.postscript, accelerator='Ctrl-p') |
filemenu.add_command(label='Print to Postscript', underline=0, command=self.postscript, accelerator='Ctrl-p') |
|
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
filemenu.add_command(label='Exit', underline=1, command=self.destroy, accelerator='Ctrl-x') |
|
menubar.add_cascade(label='File', underline=0, menu=filemenu) | menubar.add_cascade(label='File', underline=0, menu=filemenu) | |
zoommenu = Tkinter.Menu(menubar, tearoff=0) | editmenu = Menu(menubar, tearoff=0) |
Clone # 50
Anti-unification distance between two trees = 4
Total size of two trees = 72
Total length of sequences = 8
Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/ycoe.py" The first line is 107 | Source file "/home/peter/clone_digger/nltk-0.9.2/nltk/corpus/reader/ycoe.py" The first line is 105 | |
def sents(self, documents=None): return self._pos_reader.sents(self._getfiles(documents, 'pos')) |
def words(self, documents=None): return self._pos_reader.words(self._getfiles(documents, 'pos')) |
|
def paras(self, documents=None): return self._pos_reader.paras(self._getfiles(documents, 'pos')) |
def sents(self, documents=None): return self._pos_reader.sents(self._getfiles(documents, 'pos')) |
|
def tagged_words(self, documents=None): return self._pos_reader.tagged_words(self._getfiles(documents, 'pos')) |
def paras(self, documents=None): return self._pos_reader.paras(self._getfiles(documents, 'pos')) |
|
def tagged_sents(self, documents=None): return self._pos_reader.tagged_sents(self._getfiles(documents, 'pos')) |
def tagged_words(self, documents=None): return self._pos_reader.tagged_words(self._getfiles(documents, 'pos')) |
(*) Warning: the highlighting of differences is based on diff and doesn't reflect the tree-based clone detection algorithm.