chrislit/abydos

View on GitHub

Showing 4,191 of 4,191 total issues

Wrong hanging indentation before block (add 4 spaces).
Open

        self,
Severity: Info
Found in abydos/distance/_braun_blanquet.py by pylint

TODO self, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        consonants: Optional[Set[str]] = None,

TODO consonants: Optional[Set[str]] = None, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        self,
Severity: Info
Found in abydos/tokenizer/_q_skipgrams.py by pylint

TODO self, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        threshold: float = 0.0002,
Severity: Info
Found in abydos/tokenizer/_legalipy.py by pylint

TODO threshold: float = 0.0002, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        scaler: Optional[Union[str, Callable[[float], float]]] = None,
Severity: Info
Found in abydos/tokenizer/_wordpunct.py by pylint

TODO scaler: Optional[Union[str, Callable[[float], float]]] = None, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        scaler: Optional[Union[str, Callable[[float], float]]] = None,
Severity: Info
Found in abydos/tokenizer/_tokenizer.py by pylint

TODO scaler: Optional[Union[str, Callable[[float], float]]] = None, ^ |

Useless super delegation in method '__init__'
Open

    def __init__(
Severity: Minor
Found in abydos/tokenizer/_saps.py by pylint

Used whenever we can detect that an overridden method is useless, relying on super() delegation to do the same thing as another method from the MRO.

Cyclic import (abydos.distance -> abydos.distance._rouge_su)
Open

# Copyright 2014-2020 by Christopher C. Little.
Severity: Info
Found in abydos/compression/_rle.py by pylint

Used when a cyclic import between two or more modules is detected.

Similar lines in 2 files
Open

# Copyright 2014-2020 by Christopher C. Little.
Severity: Info
Found in abydos/compression/_rle.py by pylint

Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==abydos.tokenizer.corvcluster:130 ==abydos.tokenizer.vccluster:127 mode = 1 elif char in self.vowels: if mode == 1: self.orderedtokens.append(newtoken) newtoken = char else: newtoken += char mode = 2 else: # This should cover combining marks, marks, etc. new_token += char

self.orderedtokens.append(new_token)

self.orderedtokens = [ unicodedata.normalize('NFC', token) for token in self.orderedtokens ] self.scaleand_counterize() return self

if name == 'main': import doctest

doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE)

Similar lines in 3 files
Open

# Copyright 2014-2020 by Christopher C. Little.
Severity: Info
Found in abydos/compression/_rle.py by pylint

Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==abydos.tokenizer.corvcluster:76 ==abydos.tokenizer.cvcluster:77 ==abydos.tokenizer.vccluster:77 if consonants: self.consonants = consonants else: self.consonants = set('bcdfghjklmnpqrstvwxzßBCDFGHJKLMNPQRSTVWXZ') if vowels: self.vowels = vowels else: self.vowels = set('aeiouyAEIOUY') self._regexp = re.compile(r'w+|[^ws]+', flags=0)

Similar lines in 2 files
Open

# Copyright 2014-2020 by Christopher C. Little.
Severity: Info
Found in abydos/compression/_rle.py by pylint

Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==abydos.distance.jarowinkler:198 ==abydos.distance.strcmp95:200 numcom += 1 break

# If no characters in common - return if num_com == 0: return 0.0

# Count the number of transpositions k = n_trans = 0

Wrong hanging indentation before block (add 4 spaces).
Open

        flags: int = 0,
Severity: Info
Found in abydos/tokenizer/_whitespace.py by pylint

TODO flags: int = 0, ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        doc_split: str = '\n\n',
Severity: Info
Found in abydos/corpus/_corpus.py by pylint

TODO doc_split: str = 'nn', ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        filter_chars: Union[str, List[str], Set[str], Tuple[str]] = '',
Severity: Info
Found in abydos/corpus/_corpus.py by pylint

TODO filter_chars: Union[str, List[str], Set[str], Tuple[str]] = '', ^ |

Wrong hanging indentation before block (add 4 spaces).
Open

        flags: int = 0,
Severity: Info
Found in abydos/tokenizer/_wordpunct.py by pylint

TODO flags: int = 0, ^ |

Method could be a function
Open

    def decode(self, text: str) -> str:
Severity: Info
Found in abydos/compression/_rle.py by pylint

Used when a method doesn't use its bound instance, and so could be written as a function.

Wrong hanging indentation before block (add 4 spaces).
Open

        *args: Any,
Severity: Info
Found in abydos/tokenizer/_tokenizer.py by pylint

TODO *args: Any, ^ |

Cyclic import (abydos.distance -> abydos.distance._rouge_l)
Open

# Copyright 2014-2020 by Christopher C. Little.
Severity: Info
Found in abydos/compression/_rle.py by pylint

Used when a cyclic import between two or more modules is detected.

Similar lines in 2 files
Open

# Copyright 2014-2020 by Christopher C. Little.
Severity: Info
Found in abydos/compression/_rle.py by pylint

Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==abydos.phonetic.fuzzysoundex:62 ==abydos.phonetic.phonex:54 if maxlength != -1: self.maxlength = min(max(4, maxlength), 64) else: self.maxlength = 64 self.zeropad = zeropad

def encode_alpha(self, word: str) -> str: ```Return the alphabetic Fuzzy Soundex code for a word.

Parameters


word : str The word to transform

Returns


str The alphabetic Fuzzy Soundex value

Examples


pe = FuzzySoundex() pe.encodealpha('Christopher') 'KRSTP' pe.encodealpha('Niall') 'NL' pe.encodealpha('Smith') 'SNT' pe.encodealpha('Schmidt') 'SNT'

.. versionadded:: 0.4.0

code = self.encode(word).rstrip('0')
 return code[:1] + code[1:].translate(self._alphabetic)

 def encode(self, word: str) -> str:
 ```Return the Fuzzy Soundex code for a word.

 Parameters
 ----------
 word : str
 The word to transform

 Returns
 -------
 str
 The Fuzzy Soundex value

 Examples
 --------
 >>> pe = FuzzySoundex()
 >>> pe.encode('Christopher')
 'K6931'
 >>> pe.encode('Niall')
 'N4000'
 >>> pe.encode('Smith')
 'S5300'
 >>> pe.encode('Smith')
 'S5300'


 .. versionadded:: 0.1.0
 .. versionchanged:: 0.3.6
 Encapsulated in class

Unused argument 'kwargs'
Open

        self,
Severity: Minor
Found in abydos/tokenizer/_tokenizer.py by pylint

Used when a function or method argument is not used.

Severity
Category
Status
Source
Language