Repository Analysis

nltk/nltk

17.1 Moderate AI signal View on GitHub
17.1
Adjusted Score
17.1
Raw Score
100%
Time Factor
Last Push
Stars
Language
148,536
Lines of Code
418
Files
1877
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 102MEDIUM 165LOW 1610

Pattern Findings

1877 matches across 14 categories. Click a row to expand file-level details.

Unused Imports640 hits · 570 pts
SeverityFileLineSnippet
LOWtools/find_deprecated.py30
LOWnltk/downloader.py171
LOWnltk/util.py30
LOWnltk/util.py31
LOWnltk/util.py31
LOWnltk/__init__.py103
LOWnltk/__init__.py133
LOWnltk/__init__.py134
LOWnltk/__init__.py134
LOWnltk/__init__.py135
LOWnltk/__init__.py136
LOWnltk/__init__.py137
LOWnltk/__init__.py138
LOWnltk/__init__.py139
LOWnltk/__init__.py140
LOWnltk/__init__.py146
LOWnltk/__init__.py147
LOWnltk/__init__.py148
LOWnltk/__init__.py149
LOWnltk/__init__.py150
LOWnltk/__init__.py151
LOWnltk/__init__.py152
LOWnltk/__init__.py153
LOWnltk/__init__.py154
LOWnltk/__init__.py155
LOWnltk/__init__.py156
LOWnltk/__init__.py179
LOWnltk/__init__.py179
LOWnltk/__init__.py199
LOWnltk/__init__.py199
LOWnltk/__init__.py199
LOWnltk/__init__.py199
LOWnltk/__init__.py200
LOWnltk/__init__.py200
LOWnltk/__init__.py200
LOWnltk/__init__.py200
LOWnltk/__init__.py200
LOWnltk/__init__.py200
LOWnltk/__init__.py201
LOWnltk/__init__.py201
LOWnltk/__init__.py201
LOWnltk/__init__.py201
LOWnltk/__init__.py201
LOWnltk/__init__.py201
LOWnltk/__init__.py202
LOWnltk/__init__.py202
LOWnltk/__init__.py202
LOWnltk/__init__.py202
LOWnltk/__init__.py202
LOWnltk/__init__.py202
LOWnltk/__init__.py107
LOWnltk/__init__.py173
LOWnltk/__init__.py177
LOWnltk/__init__.py186
LOWnltk/grammar.py1577
LOWnltk/book.py9
LOWnltk/book.py18
LOWnltk/book.py20
LOWnltk/collocations.py36
LOWnltk/collocations.py36
580 more matches not shown…
Hyper-Verbose Identifiers376 hits · 405 pts
SeverityFileLineSnippet
LOWnltk/tgrep.py298def _tgrep_node_literal_value(node):
LOWnltk/tgrep.py382def _tgrep_nltk_tree_pos_action(_s, _l, tokens):
LOWnltk/tgrep.py629def _tgrep_conjunction_action(_s, _l, tokens, join_char="&"):
LOWnltk/tgrep.py664def _tgrep_segmented_pattern_action(_s, _l, tokens):
LOWnltk/tgrep.py706def _tgrep_node_label_use_action(_s, _l, tokens):
LOWnltk/tgrep.py725def _tgrep_node_label_pred_use_action(_s, _l, tokens):
LOWnltk/tgrep.py754def _tgrep_bind_node_label_action(_s, _l, tokens):
LOWnltk/tgrep.py793def _tgrep_rel_disjunction_action(_s, _l, tokens):
LOWnltk/downloader.py1298 def _simple_interactive_download(self, args):
LOWnltk/downloader.py1328 def _simple_interactive_update(self):
LOWnltk/downloader.py1379 def _simple_interactive_config(self):
LOWnltk/util.py385def unweighted_minimum_spanning_digraph(tree, children=iter, shapes=None, attr=None):
LOWnltk/util.py544def acyclic_branches_depth_first(
LOWnltk/util.py639def unweighted_minimum_spanning_dict(tree, children=iter):
LOWnltk/util.py684def unweighted_minimum_spanning_tree(tree, children=iter):
LOWnltk/grammar.py725 def is_flexible_chomsky_normal_form(self):
LOWnltk/grammar.py1512def _read_dependency_production(s):
LOWnltk/featstruct.py1699def _apply_forwards_to_bindings(forward, bindings):
LOWnltk/data.py60def _reject_unsafe_no_protocol(resource_url):
LOWnltk/tree/tree.py423 def treeposition_spanning_leaves(self, start, end):
LOWnltk/metrics/paice.py26def get_words_from_dictionary(lemmas):
LOWnltk/metrics/paice.py265 def _get_truncation_coordinates(self, cutlength=0):
LOWnltk/app/concordance_app.py321 def search_enter_keypress_handler(self, *event):
LOWnltk/app/concordance_app.py428 def handle_error_loading_corpus(self, event):
LOWnltk/app/chunkparser_app.py769 def _adaptively_modify_eval_chunk(self, t):
LOWnltk/app/chunkparser_app.py1215 def _syntax_highlight_grammar(self, grammar):
LOWnltk/app/rdparser_app.py986 def _animate_match_backtrack_frame(self, frame, widget, dy):
LOWnltk/app/chartparser_app.py2517 def bottom_up_leftcorner_strategy(self, *e):
LOWnltk/app/collocations_app.py259 def handle_error_loading_corpus(self, event):
LOWnltk/app/wordnet_app.py177def get_unique_counter_from_url(sp):
LOWnltk/app/wordnet_app.py875def get_static_welcome_message():
LOWnltk/classify/util.py171def binary_names_demo_features(name):
LOWnltk/classify/maxent.py1124def calculate_empirical_fcount(train_toks, encoding):
LOWnltk/classify/maxent.py1134def calculate_estimated_fcount(classifier, train_toks, encoding):
LOWnltk/classify/maxent.py206 def most_informative_features(self, n=10):
LOWnltk/classify/maxent.py220 def show_most_informative_features(self, n=10, show="all"):
LOWnltk/classify/maxent.py1028def train_maxent_classifier_with_gis(
LOWnltk/classify/maxent.py1152def train_maxent_classifier_with_iis(
LOWnltk/classify/maxent.py1405def train_maxent_classifier_with_megam(
LOWnltk/classify/naivebayes.py124 def show_most_informative_features(self, n=10):
LOWnltk/classify/naivebayes.py154 def most_informative_features(self, n=100):
LOWnltk/test/test_filestring_sandbox.py21def test_rejects_parent_traversal(tmp_path):
LOWnltk/test/test_filestring_sandbox.py36def test_rejects_symlink_escape(tmp_path):
LOWnltk/test/test_filestring_sandbox.py56def test_preserves_file_like_objects():
LOWnltk/test/unit/test_classify.py31def assert_classifier_correct(algorithm):
LOWnltk/test/unit/test_aline.py58 def test_invalid_segment_raises(self):
LOWnltk/test/unit/test_aline.py76 def test_single_char_different(self):
LOWnltk/test/unit/test_aline.py95 def test_all_consonants_in_feature_matrix(self):
LOWnltk/test/unit/test_aline.py102 def test_all_vowels_in_feature_matrix(self):
LOWnltk/test/unit/test_aline.py107 def test_no_trailing_spaces_in_consonants(self):
LOWnltk/test/unit/test_aline.py112 def test_no_trailing_spaces_in_vowels(self):
LOWnltk/test/unit/test_aline.py117 def test_no_trailing_spaces_in_feature_matrix_keys(self):
LOWnltk/test/unit/test_aline.py122 def test_consonants_not_vowel_place(self):
LOWnltk/test/unit/test_aline.py129 def test_vowels_have_vowel_place(self):
LOWnltk/test/unit/test_aline.py167 def test_delta_identical_consonants(self):
LOWnltk/test/unit/test_aline.py173 def test_delta_identical_vowels(self):
LOWnltk/test/unit/test_aline.py178 def test_delta_similar_consonants(self):
LOWnltk/test/unit/test_aline.py203 def test_sigma_exp_returns_value(self):
LOWnltk/test/unit/test_aline.py233 def test_alignment_returns_list_of_lists(self):
LOWnltk/test/unit/test_segmentation.py16def test_boundary_marker_variations():
316 more matches not shown…
Cross-File Repetition74 hits · 370 pts
SeverityFileLineSnippet
HIGHnltk/grammar.py0s -> np vp [1.0] np -> det n [0.5] | np pp [0.25] | 'john' [0.1] | 'i' [0.15] det -> 'the' [0.8] | 'my' [0.2] n -> 'man'
HIGHnltk/parse/pchart.py0s -> np vp [1.0] np -> det n [0.5] | np pp [0.25] | 'john' [0.1] | 'i' [0.15] det -> 'the' [0.8] | 'my' [0.2] n -> 'man'
HIGHnltk/parse/viterbi.py0s -> np vp [1.0] np -> det n [0.5] | np pp [0.25] | 'john' [0.1] | 'i' [0.15] det -> 'the' [0.8] | 'my' [0.2] n -> 'man'
HIGHnltk/grammar.py0s -> np vp [1.0] vp -> v np [.59] vp -> v [.40] vp -> vp pp [.01] np -> det n [.41] np -> name [.28] np -> np pp [.31] p
HIGHnltk/parse/pchart.py0s -> np vp [1.0] vp -> v np [.59] vp -> v [.40] vp -> vp pp [.01] np -> det n [.41] np -> name [.28] np -> np pp [.31] p
HIGHnltk/parse/viterbi.py0s -> np vp [1.0] vp -> v np [.59] vp -> v [.40] vp -> vp pp [.01] np -> det n [.41] np -> name [.28] np -> np pp [.31] p
HIGHnltk/collections.py0return a string representation for this corpus view that is similar to a list's representation; but if it would be more
HIGHnltk/corpus/reader/framenet.py0return a string representation for this corpus view that is similar to a list's representation; but if it would be more
HIGHnltk/corpus/reader/framenet.py0return a string representation for this corpus view that is similar to a list's representation; but if it would be more
HIGHnltk/corpus/reader/framenet.py0return a string representation for this corpus view that is similar to a list's representation; but if it would be more
HIGHnltk/corpus/reader/framenet.py0return a string representation for this corpus view that is similar to a list's representation; but if it would be more
HIGHnltk/probability.py0:rtype: str :return: a string representation of this ``probdist``.
HIGHnltk/probability.py0:rtype: str :return: a string representation of this ``probdist``.
HIGHnltk/probability.py0:rtype: str :return: a string representation of this ``probdist``.
HIGHnltk/probability.py0return a string representation of this ``probdist``. :rtype: str
HIGHnltk/probability.py0return a string representation of this ``probdist``. :rtype: str
HIGHnltk/probability.py0return a string representation of this ``probdist``. :rtype: str
HIGHnltk/probability.py0return a string representation of this ``probdist``. :rtype: str
HIGHnltk/probability.py0return a string representation of this ``probdist``. :rtype: str
HIGHnltk/app/chunkparser_app.py0enter the tkinter mainloop. this function must be called if this demo is created from a non-interactive program (e.g. fr
HIGHnltk/app/rdparser_app.py0enter the tkinter mainloop. this function must be called if this demo is created from a non-interactive program (e.g. fr
HIGHnltk/app/srparser_app.py0enter the tkinter mainloop. this function must be called if this demo is created from a non-interactive program (e.g. fr
HIGHnltk/app/chartparser_app.py0enter the tkinter mainloop. this function must be called if this demo is created from a non-interactive program (e.g. fr
HIGHnltk/sem/drt_glue_demo.py0enter the tkinter mainloop. this function must be called if this demo is created from a non-interactive program (e.g. fr
HIGHnltk/draw/tree.py0enter the tkinter mainloop. this function must be called if this demo is created from a non-interactive program (e.g. fr
HIGHnltk/translate/ibm2.py0probability of target sentence and an alignment given the source sentence
HIGHnltk/translate/ibm3.py0probability of target sentence and an alignment given the source sentence
HIGHnltk/translate/ibm4.py0probability of target sentence and an alignment given the source sentence
HIGHnltk/translate/ibm5.py0probability of target sentence and an alignment given the source sentence
HIGHnltk/translate/ibm1.py0probability of target sentence and an alignment given the source sentence
HIGHnltk/sem/drt.py0replace all instances of variable v with expression e in self, where v is free in self.
HIGHnltk/sem/drt.py0replace all instances of variable v with expression e in self, where v is free in self.
HIGHnltk/sem/drt.py0replace all instances of variable v with expression e in self, where v is free in self.
HIGHnltk/sem/drt.py0defines equality modulo alphabetic variance. if we are comparing \x.m and \y.n, then check equality of m and n[x/y].
HIGHnltk/sem/drt.py0defines equality modulo alphabetic variance. if we are comparing \x.m and \y.n, then check equality of m and n[x/y].
HIGHnltk/sem/logic.py0defines equality modulo alphabetic variance. if we are comparing \x.m and \y.n, then check equality of m and n[x/y].
HIGHnltk/sem/glue.py0pick an alphabetic character as identifier for an entity in the model. :param value: where to index into the list of cha
HIGHnltk/sem/lfg.py0pick an alphabetic character as identifier for an entity in the model. :param value: where to index into the list of cha
HIGHnltk/inference/mace.py0pick an alphabetic character as identifier for an entity in the model. :param value: where to index into the list of cha
HIGHnltk/sem/linearlogic.py0from iddo lev's phd dissertation p108-109 :param index_counter: ``counter`` for unique indices :param glueformulafactory
HIGHnltk/sem/linearlogic.py0from iddo lev's phd dissertation p108-109 :param index_counter: ``counter`` for unique indices :param glueformulafactory
HIGHnltk/sem/linearlogic.py0from iddo lev's phd dissertation p108-109 :param index_counter: ``counter`` for unique indices :param glueformulafactory
HIGHnltk/corpus/reader/aligned.py0:return: the given file(s) as a list of words and punctuation symbols. :rtype: list(str)
HIGHnltk/corpus/reader/plaintext.py0:return: the given file(s) as a list of words and punctuation symbols. :rtype: list(str)
HIGHnltk/corpus/reader/chunked.py0:return: the given file(s) as a list of words and punctuation symbols. :rtype: list(str)
HIGHnltk/corpus/reader/tagged.py0:return: the given file(s) as a list of words and punctuation symbols. :rtype: list(str)
HIGHnltk/corpus/reader/semcor.py0:return: the given file(s) as a list of words and punctuation symbols. :rtype: list(str)
HIGHnltk/corpus/reader/aligned.py0:return: the given file(s) as a list of sentences or utterances, each encoded as a list of word strings. :rtype: list(li
HIGHnltk/corpus/reader/plaintext.py0:return: the given file(s) as a list of sentences or utterances, each encoded as a list of word strings. :rtype: list(li
HIGHnltk/corpus/reader/chunked.py0:return: the given file(s) as a list of sentences or utterances, each encoded as a list of word strings. :rtype: list(li
HIGHnltk/corpus/reader/tagged.py0:return: the given file(s) as a list of sentences or utterances, each encoded as a list of word strings. :rtype: list(li
HIGHnltk/corpus/reader/plaintext.py0:return: the given file(s) as a list of paragraphs, each encoded as a list of sentences, which are in turn encoded as li
HIGHnltk/corpus/reader/chunked.py0:return: the given file(s) as a list of paragraphs, each encoded as a list of sentences, which are in turn encoded as li
HIGHnltk/corpus/reader/tagged.py0:return: the given file(s) as a list of paragraphs, each encoded as a list of sentences, which are in turn encoded as li
HIGHnltk/corpus/reader/framenet.py0displays an abbreviated repr of only the first several elements, not the whole list.
HIGHnltk/corpus/reader/framenet.py0displays an abbreviated repr of only the first several elements, not the whole list.
HIGHnltk/corpus/reader/framenet.py0displays an abbreviated repr of only the first several elements, not the whole list.
HIGHnltk/corpus/reader/framenet.py0displays an abbreviated repr of only the first several elements, not the whole list.
HIGHnltk/parse/recursivedescent.py0set the level of tracing output that should be generated when parsing a text. :type trace: int :param trace: the trace l
HIGHnltk/parse/pchart.py0set the level of tracing output that should be generated when parsing a text. :type trace: int :param trace: the trace l
14 more matches not shown…
Deep Nesting365 hits · 342 pts
SeverityFileLineSnippet
LOWtools/find_deprecated.py116
LOWtools/find_deprecated.py151
LOWnltk/internals.py494
LOWnltk/internals.py684
LOWnltk/internals.py1089
LOWnltk/tgrep.py322
LOWnltk/tgrep.py398
LOWnltk/downloader.py2677
LOWnltk/downloader.py523
LOWnltk/downloader.py677
LOWnltk/downloader.py833
LOWnltk/downloader.py948
LOWnltk/downloader.py1050
LOWnltk/downloader.py1257
LOWnltk/downloader.py1298
LOWnltk/downloader.py1328
LOWnltk/downloader.py1379
LOWnltk/downloader.py1792
LOWnltk/downloader.py1888
LOWnltk/downloader.py1956
LOWnltk/downloader.py2047
LOWnltk/downloader.py2281
LOWnltk/toolbox.py274
LOWnltk/toolbox.py461
LOWnltk/util.py221
LOWnltk/util.py300
LOWnltk/util.py342
LOWnltk/util.py431
LOWnltk/util.py471
LOWnltk/util.py544
LOWnltk/util.py639
LOWnltk/util.py1144
LOWnltk/pathsec.py70
LOWnltk/pathsec.py157
LOWnltk/pathsec.py202
LOWnltk/pathsec.py245
LOWnltk/grammar.py1362
LOWnltk/grammar.py1427
LOWnltk/grammar.py563
LOWnltk/grammar.py842
LOWnltk/cli.py42
LOWnltk/collections.py63
LOWnltk/collections.py396
LOWnltk/probability.py693
LOWnltk/featstruct.py1169
LOWnltk/featstruct.py1254
LOWnltk/featstruct.py1578
LOWnltk/featstruct.py2606
LOWnltk/featstruct.py154
LOWnltk/featstruct.py642
LOWnltk/featstruct.py680
LOWnltk/featstruct.py698
LOWnltk/featstruct.py777
LOWnltk/featstruct.py821
LOWnltk/featstruct.py957
LOWnltk/featstruct.py973
LOWnltk/featstruct.py991
LOWnltk/featstruct.py1049
LOWnltk/featstruct.py2318
LOWnltk/data.py577
305 more matches not shown…
Decorative Section Separators55 hits · 191 pts
SeverityFileLineSnippet
MEDIUMnltk/langnames.py100# =======================================================================
MEDIUMnltk/langnames.py148# ======================================================================
MEDIUMnltk/downloader.py70# ----------------------------------------------------------------------
MEDIUMnltk/tabdata.py60# ---------------------------------------------------------------------------
MEDIUMnltk/tabdata.py62# ---------------------------------------------------------------------------
MEDIUMnltk/tabdata.py98# ---------------------------------------------------------------------------
MEDIUMnltk/tabdata.py100# ---------------------------------------------------------------------------
MEDIUMnltk/data.py232 # ----------------------------------------------------------------------
MEDIUMnltk/data.py234 # ----------------------------------------------------------------------
MEDIUMnltk/chunk/named_entity.py317# ======================================================================================
MEDIUMnltk/chunk/named_entity.py359# ======================================================================================
MEDIUMnltk/test/unit/test_aline.py87# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_aline.py89# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py164 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py166 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py199 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py201 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py140 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py142 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py183 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_distance.py185 # ---------------------------------------------------------
MEDIUMnltk/test/unit/test_corpus_util.py16# ----------------------------------------------------------------------
MEDIUMnltk/test/unit/test_corpus_util.py18# ----------------------------------------------------------------------
MEDIUMnltk/test/unit/test_corpus_util.py79# ----------------------------------------------------------------------
MEDIUMnltk/test/unit/test_corpus_util.py81# ----------------------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py14# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py16# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py43# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py45# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py86# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py89# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py203# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py205# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py217# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py219# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py310# ---------------------------------------------------------
MEDIUMnltk/test/unit/test_verbnet.py312# ---------------------------------------------------------
MEDIUMnltk/sem/drt.py1010 # ==========================================================
MEDIUMnltk/sem/drt.py1012 # ==========================================================
MEDIUMnltk/corpus/reader/api.py508 # ------------------------------------------------------------
MEDIUMnltk/corpus/reader/api.py529 # ------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py74# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py76# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py90# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py92# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py113# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py115# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py175# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py177# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py260# ---------------------------------------------------------------------------
MEDIUMnltk/huggingface/dataset.py262# ---------------------------------------------------------------------------
MEDIUMnltk/ccg/lexicon.py18# ------------
MEDIUMnltk/ccg/lexicon.py20# ------------
MEDIUMnltk/ccg/lexicon.py130# -----------
MEDIUMnltk/ccg/lexicon.py132# -----------
Self-Referential Comments75 hits · 189 pts
SeverityFileLineSnippet
MEDIUMtools/find_deprecated.py55# Define a regexp to search for deprecated definitions.
MEDIUMnltk/downloader.py863 # Define a helper function for displaying output:
MEDIUMnltk/downloader.py1525 # Create the main window.
MEDIUMnltk/downloader.py1572 # Create the top-level frame structures
MEDIUMnltk/downloader.py1595 # Create the tabs
MEDIUMnltk/downloader.py1604 # Create the table.
MEDIUMnltk/downloader.py1710 # Create a menu to control which columns of the table are
MEDIUMnltk/downloader.py1725 # Create a sort menu
MEDIUMnltk/downloader.py2225 # Create a new data server object for the download operation,
MEDIUMnltk/toolbox.py325 """This class is the base class for settings files."""
MEDIUMnltk/lazyimport.py1# This module is from mx/DateTime/LazyModule.py and is
MEDIUMnltk/text.py214 # Create the pretty lines with the query_word in the middle.
MEDIUMnltk/text.py221 # Create the ConcordanceLine
MEDIUMnltk/text.py584 # Create the model when using it the first time.
MEDIUMnltk/probability.py1176 # Create a heldout probability distribution for each pair of
MEDIUMnltk/probability.py1325# This method is problematic because the situation ``N(c+1) == 0``
MEDIUMnltk/featstruct.py2243 # Create the new feature structure
MEDIUMnltk/tree/transforms.py128 # This method is 7x faster which helps when parsing 40,000 sentences.
MEDIUMnltk/app/rdparser_app.py113 # Create the basic frames.
MEDIUMnltk/app/srparser_app.py122 # Create the basic frames.
MEDIUMnltk/app/chartparser_app.py449 # Create a widget for it.
MEDIUMnltk/app/chartparser_app.py1054 # Create the chart canvas.
MEDIUMnltk/app/chartparser_app.py1059 # Create the sentence canvas.
MEDIUMnltk/app/chartparser_app.py1070 # Create the tree canvas.
MEDIUMnltk/app/chartparser_app.py1789 # Create the root window.
MEDIUMnltk/classify/util.py243 # Create a list of male names to be used as positive-labeled examples for training
MEDIUMnltk/classify/util.py246 # Create a list of male and female names to be used as unlabeled examples
MEDIUMnltk/classify/util.py249 # Create a test set with correctly-labeled male and female names
MEDIUMnltk/classify/__init__.py49 >>> # Define a feature detector function.
MEDIUMnltk/classify/positivenaivebayes.py142 # Create the P(label) distribution.
MEDIUMnltk/classify/positivenaivebayes.py147 # Create the P(fval|label, fname) distribution.
MEDIUMnltk/classify/naivebayes.py235 # Create the P(label) distribution
MEDIUMnltk/classify/naivebayes.py238 # Create the P(fval|label, fname) distribution
MEDIUMnltk/test/unit/test_downloader_atomic.py25# Create a custom server class to safely track requests
MEDIUMnltk/test/unit/test_corpus_reader.py22 # Create a symlink inside corpus_root that points outside corpus_root
MEDIUMnltk/sem/drt.py84 """This method is intended to be overridden for logics that
MEDIUMnltk/sem/util.py141 # Initialize a variable assignment with parameter ``dom``
MEDIUMnltk/sem/logic.py1874 """This class represents implications"""
MEDIUMnltk/sem/logic.py1881 """This class represents biconditionals"""
MEDIUMnltk/sem/logic.py1888 """This class represents equality expressions like "(x = y)"."""
MEDIUMnltk/sem/logic.py300 """This method is intended to be overridden for logics that
MEDIUMnltk/sem/logic.py1403 """This class represents a variable to be used as a predicate or entity"""
MEDIUMnltk/sem/logic.py1475 """This class represents variables that take the form of a single lowercase
MEDIUMnltk/sem/logic.py1505 """This class represents variables that take the form of a single uppercase
MEDIUMnltk/sem/logic.py1520 """This class represents variables that take the form of a single lowercase
MEDIUMnltk/sem/logic.py1527 """This class represents variables that do not take the form of a single
MEDIUMnltk/sem/logic.py1848 """This class represents conjunctions"""
MEDIUMnltk/sem/logic.py1861 """This class represents disjunctions"""
MEDIUMnltk/sem/drt_glue_demo.py55 # Create the basic frames.
MEDIUMnltk/corpus/europarl_raw.py13# Create a new corpus reader instance for each European language
MEDIUMnltk/parse/pchart.py508 # Define a list of parsers. We'll use all parsers.
MEDIUMnltk/parse/chart.py602 # Create the index.
MEDIUMnltk/parse/nonprojectivedependencyparser.py506 # Create a new node v_n+1 with address = len(nodes) + 1
MEDIUMnltk/parse/featurechart.py201 # Create the index.
MEDIUMnltk/parse/featurechart.py285 # Create a copy of the bindings.
MEDIUMnltk/parse/featurechart.py298 # Create a copy of the bindings.
MEDIUMnltk/parse/earleychart.py103 # Create the index.
MEDIUMnltk/parse/earleychart.py153 # Create the index.
MEDIUMnltk/draw/cfg.py185 # Create the top-level window.
MEDIUMnltk/draw/cfg.py248 # Create the basic Text widget & scrollbar.
15 more matches not shown…
Cross-Language Confusion28 hits · 160 pts
SeverityFileLineSnippet
HIGHnltk/featstruct.py537 Return True if ``self`` subsumes ``other``. I.e., return true
HIGHnltk/featstruct.py1481 contain the unified value, the value of ``fstruct2`` is undefined,
HIGHnltk/cluster/util.py157 queue.push((priority, node))
HIGHnltk/app/chartparser_app.py1237 edgelen = max(edge.length(), 1)
HIGHnltk/classify/maxent.py1125 fcount = numpy.zeros(encoding.length(), "d")
HIGHnltk/classify/maxent.py1135 fcount = numpy.zeros(encoding.length(), "d")
HIGHnltk/classify/maxent.py118 assert encoding.length() == len(weights)
HIGHnltk/classify/maxent.py130 assert self._encoding.length() == len(new_weights)
HIGHnltk/classify/maxent.py239 self._encoding.length(),
HIGHnltk/classify/maxent.py1346 deltas = numpy.ones(encoding.length(), "d")
HIGHnltk/classify/maxent.py1351 A = numpy.zeros((len(nfmap), encoding.length()), "d")
HIGHnltk/classify/maxent.py1483 weights = parse_megam_weights(stdout, encoding.length(), explicit)
HIGHnltk/classify/tadm.py115 for i in range(encoding.length()):
HIGHnltk/test/unit/translate/test_stack_decoder.py241 stack.push(_Hypothesis(0.2))
HIGHnltk/test/unit/translate/test_stack_decoder.py242 stack.push(poor_hypothesis)
HIGHnltk/test/unit/translate/test_stack_decoder.py243 stack.push(_Hypothesis(0.1))
HIGHnltk/test/unit/translate/test_stack_decoder.py244 stack.push(_Hypothesis(0.3))
HIGHnltk/test/unit/translate/test_stack_decoder.py256 stack.push(poor_hypothesis)
HIGHnltk/test/unit/translate/test_stack_decoder.py257 stack.push(worse_hypothesis)
HIGHnltk/test/unit/translate/test_stack_decoder.py258 stack.push(_Hypothesis(0.9)) # greatly superior hypothesis
HIGHnltk/test/unit/translate/test_stack_decoder.py270 stack.push(_Hypothesis(0.9)) # greatly superior hypothesis
HIGHnltk/test/unit/translate/test_stack_decoder.py271 stack.push(poor_hypothesis)
HIGHnltk/test/unit/translate/test_stack_decoder.py282 stack.push(_Hypothesis(0.0))
HIGHnltk/test/unit/translate/test_stack_decoder.py283 stack.push(best_hypothesis)
HIGHnltk/test/unit/translate/test_stack_decoder.py284 stack.push(_Hypothesis(0.5))
HIGHnltk/parse/pchart.py422 queue.sort(key=lambda edge: edge.length())
HIGHnltk/parse/chart.py565 :param length: Only generate edges ``e`` where ``e.length()==length``
HIGHnltk/parse/chart.py829 edges = sorted((e.length(), e.start(), e) for e in self)
Excessive Try-Catch Wrapping105 hits · 127 pts
SeverityFileLineSnippet
LOWtools/global_replace.py38 except Exception:
MEDIUMtools/global_replace.py19def update(file, pattern, replacement):
LOWtools/huggingface/push_stopwords.py199 except Exception:
MEDIUMnltk/downloader.py1291 print("Error reading from server: %s" % e)
MEDIUMnltk/downloader.py1293 print("Error connecting to server: %s" % e.reason)
MEDIUMnltk/downloader.py1407 print(f"Error reading <{new_url!r}>:\n {e}")
MEDIUMnltk/downloader.py1956def _download_cb(self, download_iter, ids):
LOWnltk/downloader.py1158 except Exception:
LOWnltk/downloader.py1406 except Exception as e:
LOWnltk/downloader.py2137 except Exception:
LOWnltk/downloader.py2483 except Exception as e:
LOWnltk/downloader.py2510 except Exception as e:
LOWnltk/downloader.py2521 except Exception as e:
LOWnltk/downloader.py2524 except Exception as e:
LOWnltk/downloader.py2699 except Exception as e:
LOWnltk/downloader.py2703 except Exception as e:
LOWnltk/pathsec.py152 except Exception:
LOWnltk/pathsec.py232 except Exception:
LOWnltk/featstruct.py2703 except Exception:
LOWnltk/data.py480 except Exception as e:
LOWnltk/metrics/distance.py276 except Exception:
MEDIUMnltk/twitter/twitterclient.py100 print(f"Error (stream will continue): {e}")
MEDIUMnltk/twitter/twitterclient.py117 print(f"Error (stream will continue): {e}")
LOWnltk/app/concordance_app.py403 except Exception:
LOWnltk/app/concordance_app.py654 except Exception as e:
MEDIUMnltk/app/concordance_app.py647def run(self):
LOWnltk/app/chunkparser_app.py1463 except Exception:
MEDIUMnltk/app/chunkparser_app.py1333def _chunkparse(self, words):
LOWnltk/app/rdparser_app.py711 except Exception:
LOWnltk/app/rdparser_app.py725 except Exception:
LOWnltk/app/srparser_app.py656 except Exception:
LOWnltk/app/srparser_app.py671 except Exception:
MEDIUMnltk/app/chartparser_app.py1816 print("Error creating Tree View")
LOWnltk/app/chartparser_app.py188 except Exception:
LOWnltk/app/chartparser_app.py532 except Exception:
LOWnltk/app/chartparser_app.py622 except Exception:
LOWnltk/app/chartparser_app.py800 except Exception as e:
LOWnltk/app/chartparser_app.py811 except Exception as e:
LOWnltk/app/chartparser_app.py1815 except Exception:
LOWnltk/app/chartparser_app.py2241 except Exception:
LOWnltk/app/chartparser_app.py2283 except Exception as e:
LOWnltk/app/chartparser_app.py2297 except Exception as e:
LOWnltk/app/chartparser_app.py2316 except Exception as e:
LOWnltk/app/chartparser_app.py2338 except Exception as e:
LOWnltk/app/collocations_app.py421 except Exception as e:
MEDIUMnltk/app/collocations_app.py406def run(self):
LOWnltk/app/nemo_app.py95 except Exception:
LOWnltk/app/nemo_app.py115 except Exception:
LOWnltk/classify/weka.py72 except Exception:
MEDIUMnltk/classify/weka.py67def _check_weka_version(jar):
LOWnltk/test/unit/test_twitter_auth.py66 except Exception as e:
LOWnltk/sem/boxer.py990 except Exception as e:
MEDIUMnltk/sem/boxer.py827def handle(self, tok, context):
LOWnltk/sem/glue.py241 except Exception:
LOWnltk/sem/glue.py651 except Exception as e:
MEDIUMnltk/sem/glue.py655 print("Error when checking logical equality of statements", e)
LOWnltk/sem/drt_glue_demo.py405 except Exception:
LOWnltk/sem/drt_glue_demo.py471 except Exception as e:
LOWnltk/corpus/reader/nkjp.py275 except Exception as e:
LOWnltk/corpus/reader/nkjp.py351 except Exception as e:
45 more matches not shown…
Redundant / Tautological Comments54 hits · 81 pts
SeverityFileLineSnippet
LOWnltk/jsontags.py64 # Check if we have a tagged object.
LOWnltk/internals.py316# Check if a method has been overridden
LOWnltk/internals.py535 # Check if the alternative is inside a 'file' directory
LOWnltk/internals.py551 # Check if the environment variable contains a direct path to the bin
LOWnltk/internals.py557 # Check if the possible bin names exist inside the environment variable directories
LOWnltk/internals.py565 # Check if the alternative is inside a 'file' directory
LOWnltk/internals.py568 # Check if the alternative is inside a 'bin' directory
LOWnltk/downloader.py817 # Check if it needs to be unzipped.
LOWnltk/downloader.py986 # Check if the file has the correct size.
LOWnltk/downloader.py994 # Check if the file's checksum matches.
LOWnltk/downloader.py1054 # Check if the index is already up-to-date. If so, do nothing.
LOWnltk/downloader.py1180 # Check if we are on GAE where we cannot write into filesystem.
LOWnltk/downloader.py1184 # Check if we have sufficient permissions to install in a
LOWnltk/downloader.py2269 # Check if we've been told to kill ourselves:
LOWnltk/util.py679 queue.append(child) # Add child to queue
LOWnltk/__init__.py181# Check if tkinter exists without importing it to avoid crashes after
LOWnltk/collections.py468 # Return the value
LOWnltk/probability.py2499 # Print the results in a formatted table.
LOWnltk/featstruct.py1780 # Print the result.
LOWnltk/featstruct.py2355 # Check if it's a special feature.
LOWnltk/featstruct.py2361 # Check if this feature has a value already.
LOWnltk/data.py625 # Check if the resource name includes a zipfile name
LOWnltk/data.py1624 # Return the result
LOWnltk/app/chunkparser_app.py714 # Check if we've seen this grammar already. If so, then
LOWnltk/app/chunkparser_app.py748 # Check if we're done
LOWnltk/app/chunkparser_app.py1301 # Display the results
LOWnltk/app/rdparser_app.py644 # Check if we just completed a parse.
LOWnltk/app/chartparser_app.py1273 # Check if we can fit the edge in this level.
LOWnltk/app/wordnet_app.py130 # Set type to plain to prevent XSS by printing the path as HTML
LOWnltk/classify/weka.py119 # Check if something went wrong:
LOWnltk/classify/weka.py344 # Check if the tokens are labeled or unlabeled. If unlabeled,
LOWnltk/classify/maxent.py726 # Return the result
LOWnltk/classify/megam.py100 # Write the file, which contains one line per instance.
LOWnltk/translate/phrase_based.py60 # Check if alignment points are consistent.
LOWnltk/corpus/reader/util.py247 # Check if it's in the cache.
LOWnltk/corpus/reader/util.py259 # Check if it's in the cache.
LOWnltk/corpus/reader/wordnet.py1915 # Open the file for reading. Note that we can not re-use
LOWnltk/parse/pchart.py266 # Assign probabilities to the trees.
LOWnltk/parse/chart.py648 # Add it to the list of edges.
LOWnltk/parse/nonprojectivedependencyparser.py628 # Set roots to attempt
LOWnltk/parse/earleychart.py539 # Print results.
LOWnltk/stem/porter.py712 # Print the results.
LOWnltk/stem/lancaster.py176 # Check if a user wants to strip prefix
LOWnltk/stem/lancaster.py178 # Check if a user wants to use his/her own rule tuples.
LOWnltk/inference/tableau.py106 # Check if the branch is closed. Return 'True' if it is
LOWnltk/inference/tableau.py129 # Check if the branch is closed. Return 'True' if it is
LOWnltk/inference/tableau.py152 # Check if the branch is closed. Return 'True' if it is
LOWnltk/inference/tableau.py166 # Check if the branch is closed. Return 'True' if it is
LOWnltk/tag/brill_trainer.py531 # Check if the change causes any rule at this position to
LOWnltk/tag/brill_trainer.py540 # Check if the change causes our templates to propose any
LOWnltk/tokenize/punkt.py1676 # Check if any initials or ordinals tokens that are marked
LOWnltk/ccg/chart.py172 # Check if the two edges are permitted to combine.
LOWnltk/ccg/chart.py305 # Output the resulting parses
LOWnltk/ccg/chart.py427 # Print the resulting category on a new line.
Over-Commented Block79 hits · 74 pts
SeverityFileLineSnippet
LOWtools/global_replace.py1#!/usr/bin/env python
LOWtools/github_actions/third-party.sh101
LOWnltk/grammar.py1# Natural Language Toolkit: Context Free Grammars
LOWnltk/probability.py1# Natural Language Toolkit: Probability and Statistics
LOWnltk/probability.py1301##//////////////////////////////////////////////////////
LOWnltk/probability.py1321# where *c* is the original count, *N(i)* is the number of event types
LOWnltk/probability.py1341# appropriate for high values of r. For low values of r, they use the
LOWnltk/probability.py1661##//////////////////////////////////////////////////////
LOWnltk/probability.py1681# titled "Improved backing-off for n-gram language modeling." In the same paper
LOWnltk/collocations.py381 )
LOWnltk/data.py221 except ValueError:
LOWnltk/decorators.py241## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LOWnltk/misc/sort.py1# Natural Language Toolkit: List Sorting
LOWnltk/tree/immutable.py1# Natural Language Toolkit: Text Trees
LOWnltk/tree/parented.py1# Natural Language Toolkit: Text Trees
LOWnltk/tree/tree.py1# Natural Language Toolkit: Text Trees
LOWnltk/tree/parsing.py1# Natural Language Toolkit: Text Trees
LOWnltk/tree/probabilistic.py1# Natural Language Toolkit: Text Trees
LOWnltk/app/srparser_app.py821 # Display the available productions.
LOWnltk/app/srparser_app.py841 # color='#000000', font=self._font)
LOWnltk/app/chartparser_app.py2561 # ChartComparer(*charts).mainloop()
LOWnltk/app/wordnet_app.py201 # The webbrowser module is unpredictable, typically it blocks if it uses
LOWnltk/classify/api.py161# strs or ints, but can be any immutable type. The set
LOWnltk/classify/api.py181# the *i*\ th element of ``featuresets``.
LOWnltk/test/pytest.ini1[pytest]
LOWnltk/test/unit/test_distance.py21 # without transpositions:
LOWnltk/test/unit/test_distance.py41 ("rain", "shine", 1, (3, 3)),
LOWnltk/test/unit/test_distance.py61 ("lnaguaeg", "language", 2, (2, 4)), # Doesn't *require* substitutions
LOWnltk/test/unit/test_distance.py81 #
LOWnltk/test/unit/lm/test_models.py101def test_mle_bigram_entropy_perplexity_unseen(mle_bigram_model):
LOWnltk/test/unit/lm/test_models.py161 return model
LOWnltk/test/unit/lm/test_models.py261 ("d", ["c"], 2.0 / 9),
LOWnltk/test/unit/lm/test_models.py321 "word, context, expected_score",
LOWnltk/test/unit/lm/test_models.py381 # = 1 / 14
LOWnltk/test/unit/lm/test_models.py441 # P(c|b) = alpha('bc') + gamma('b') * P(c)
LOWnltk/chat/zen.py81 ),
LOWnltk/chat/eliza.py1# Natural Language Toolkit: Eliza
LOWnltk/translate/ibm1.py1# Natural Language Toolkit: IBM Model 1
LOWnltk/sem/chat80.py641
LOWnltk/sem/hole.py221 plug_acc = plug_acc0.copy()
LOWnltk/sem/boxer.py461 # self.assertToken(self.token(), ':')
LOWnltk/corpus/__init__.py501# ipipan = LazyCorpusLoader(
LOWnltk/corpus/reader/framenet.py3301
LOWnltk/corpus/reader/framenet.py3401 allcorpora = {x.corpname for x in fn.docs_metadata()}
LOWnltk/corpus/reader/wordnet.py1# Natural Language Toolkit: WordNet
LOWnltk/corpus/reader/wordnet.py41
LOWnltk/corpus/reader/wordnet.py981 # including a correction:
LOWnltk/parse/pchart.py361
LOWnltk/parse/nonprojectivedependencyparser.py1# Natural Language Toolkit: Dependency Grammars
LOWnltk/parse/transitionparser.py581 # Using decision function to build the votes array
LOWnltk/tbl/rule.py1# Natural Language Toolkit: Transformation-based learning
LOWnltk/stem/arlstem.py1#
LOWnltk/stem/rslp.py1# Natural Language Toolkit: RSLP Stemmer
LOWnltk/stem/snowball.py1#
LOWnltk/stem/porter.py621 # Earlier in step2b we had the rules:
LOWnltk/sentiment/vader.py1# Natural Language Toolkit: vader
LOWnltk/sentiment/util.py881 demo_tweets(naive_bayes)
LOWnltk/draw/cfg.py1# Natural Language Toolkit: CFG visualization
LOWnltk/draw/cfg.py21# - the user can drag the treelet onto one of those (or click on them?)
LOWnltk/draw/cfg.py301 else:
19 more matches not shown…
AI Slop Vocabulary22 hits · 29 pts
SeverityFileLineSnippet
MEDIUMnltk/util.py251 # FIX: Use is_relative_to for robust boundary check
LOWnltk/collections.py267 # If the slice is small enough, just use a tuple.
LOWnltk/text.py121 # nothing in common -- just return an empty freqdist.
LOWnltk/probability.py1330# Simple Good-Turing. As a smoothing curve they simply use a power curve:
LOWnltk/featstruct.py319 # their children a second time, so just return true.
LOWnltk/data.py978 # If we've cached the resource, then just return it.
LOWnltk/data.py1550 # If nothing's buffered, then just return our current filepos:
LOWnltk/app/chunkparser_app.py715 # just use the old evaluation values.
LOWnltk/test/unit/test_downloader.py65 # Cannot mock a zip here as we are trying to validate file checksums, so just create a simple one with the XML
LOWnltk/translate/ribes_score.py284 # To avoid this, we can just return the lowest possible score.
MEDIUMnltk/sem/drt.py151 """This method serves as a hook for other logic parsers that
MEDIUMnltk/sem/drt.py156 """This method serves as a hook for other logic parsers that
MEDIUMnltk/sem/logic.py433 """This method serves as a hook for other logic parsers that
MEDIUMnltk/sem/logic.py471 """This method serves as a hook for other logic parsers that
MEDIUMnltk/sem/logic.py492 """This method serves as a hook for other logic parsers that
LOWnltk/corpus/__init__.py194# [XX] This should probably just use TaggedCorpusReader:
LOWnltk/corpus/reader/verbnet.py167 # File identifier: just return the xml.
LOWnltk/corpus/reader/framenet.py1138 # as it's easier to just call frame().
LOWnltk/corpus/reader/semcor.py198 # solution: just use the lemma name as a string
LOWnltk/parse/chart.py1171 # just return (no new edges to add).
LOWnltk/parse/featurechart.py375 # just return (no new edges to add).
LOWnltk/parse/featurechart.py560 # already in the chart, then just return it as-is.
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMnltk/app/chunkparser_app.py114 #: for a list of tags you can use for colorizing.
Dead Code1 hit · 2 pts
SeverityFileLineSnippet
MEDIUMnltk/app/chartparser_app.py628
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippet
LOWnltk/app/nemo_app.py18Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna ali
LOWnltk/app/nemo_app.py18Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna ali