Namesake is an open-source tool for assessing confusing naming combinations in Python programs. Namesake flags confusing identifier naming combinations that are similar in:
- Orthography (word form)
- Phonology (pronunciation)
- or Semantics (meaning)
Lexical access describes the retrieval of word shape (orthography), pronunciation (phonology), and meaning (semantics) from memory during reading for comprehension.
Orthographic similarity focuses on the the similarity in word form on the level of letters. Not to be confused by editing distance or Levenshtein's distance, where one letter is replaced by another, orthographic similarity focuses on the similarities between letters shapes. A good example is the confusion between 'O' and 'C' as individual letters or within words and sentences. Here's a common exmple in code:
Phonological similarity describes two words that share a similar or identical pronunciation, also known as homophones:
Semantic similarity describes words that share a meaning (synonyms):
first, to install the requirements:
pip install -r requirements.txt
To run Namesake on the file test1.py (with optional similarity thresholds):
python namesake.py test1.py [orth_threshold] [phon_threshold] [sem_threshold]
Threshold values must be between 0 and 1.
MIT (Free Software, Hell Yeah!)