namebot.scoring module

Provides various scoring methods for word strength.

namebot.scoring.bounded(num, start, end)[source]

Determine if a number is within the bounds of start and end.

Parameters:
  • (int) (end) – An integer.
  • (int) – A start minimum.
  • (int) – An end maximum.
Rtype is_bounded (bool):
 

Whether number is bounded by start and end.

namebot.scoring.generate_all_scoring(words)[source]

Return all scoring methods for a set of words.

Parameters:(list) (words) – the list of words.
Rtype words (dict):
 the scores, keyed by scoring name.
namebot.scoring.score_dmetaphone(words)[source]

Score words using the double metaphone algorithm.

Parameters:(list) (words) – the list of words.
Rtype scores (list):
 the scored words
namebot.scoring.score_length(word)[source]

Return a score, 1-5, of the length of the word.

Really long, or really short words get a lower score. There is no hard science, but popular opinion suggests that a word somewhere between 8-15 letters is optimal.

Parameters:(str) (word) – The word to score.
Rtype score (int):
 The resulting score.
namebot.scoring.score_name_overall(word)[source]

Score the name using separate scoring functions, then normalize to 100.

This method gives an overall intuitive score. The closer to 100%, the better.

Parameters:(string) (word) – the name
Rtype score (float):
 the final name score
namebot.scoring.score_names_overall(words)[source]

Score all names.

Parameters:(list) (words) – the list of words.
Rtype words (list):
 a list of tuples, with the score and word.
namebot.scoring.score_nysiis(words)[source]

Score words using the nysiis algorithm.

Parameters:(list) (words) – the list of words.
Rtype scores (list):
 the scored words
namebot.scoring.score_pronounceability(word)[source]

Get the ratio of vowels to consonants, a very basic measurement.

Half vowels and half consonants indicates a highly pronounceable word. For example, 0.5 / 0.5 = 1.0, so one is perfect, and lower is worse.

The 1-5 scale translation:

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0 1 2 3 4 5 4 3 2 1 5

Parameters:(string) (word) – The name
Rtype (int):The final pronounceability score
namebot.scoring.score_simplicity(word)[source]

Determine how simple the word is.

Simple is defined as the number of separate words. In this case, higher is better, indicating a better score.

Parameters:(string) (word) – the name
Rtype score (int):
 the final simplicity score
>>> score_simplicity('the cat in the hat')
>>> 1
>>> score_simplicity('facebook')
>>> 5
namebot.scoring.score_soundex(words)[source]

Score words using the soundex algorithm.

Parameters:(list) (words) – the list of words.
Rtype scores (list):
 the scored words