namebot.techniques module¶
Primary techniques for the core functionality of namebot.
-
namebot.techniques.
acronym_lastname
(description, lastname)[source]¶ Create an acronym plus the last name.
Inspiration: ALFA Romeo.
-
namebot.techniques.
all_prefix_first_vowel
(word, letters=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])[source]¶ Find the first vowel in a word and prefixes with consonants.
- Args:
- word (str) - the word to update letters (list) - the letters to use for prefixing.
- Returns:
- words (list) - All prefixed words
-
namebot.techniques.
backronym
(acronym, theme, max_attempts=10)[source]¶ Attempt to generate a backronym based on a given acronym and theme.
- Args:
- acronym (str): The starting acronym. theme (str): The seed word to base other words off of. max_attempts (int, optional): The number of attempts before failing.
- Returns:
- dict: The result dictionary. If a backronym was successfully generated,
- the success key will be True, otherwise False.
-
namebot.techniques.
disfixify
(words, replaces=1)[source]¶ Apply a disfix technique to a set of words.
Disfixing is done by removing the first set of vowel-consonant pairs.
- Args:
words (list) - The list of words to operate on. replaces (int, optional): Number of replacements
to make on this string.- Returns:
- new_arr (list): the updated *fixed words
-
namebot.techniques.
domainify
(words, tld='com')[source]¶ Convert words into a domain format for testing domains.
- Args:
- words (list): List of words tld (str, optional): The TLD (top-level domain) to use.
- Returns:
- list: The modified list of words.
>>> domanify(['radio'], tld='.io') >>> ['rad.io']
-
namebot.techniques.
duplifixify
(words)[source]¶ Apply a duplifix technique to a set of words (e.g: teeny weeny, etc...).
- Args:
- words (list) - The list of words to operate on.
- Returns:
- new_arr (list): the updated *fixed words
-
namebot.techniques.
forkerism
(words)[source]¶ Convert a list of words formatted with the forkerism technique.
- Args:
- words (list) - The list of words to operate on
- Returns:
- words (list) - The updated list of words
>>> forkerism(['foo', 'bar']) >>> ['for', 'bao']
-
namebot.techniques.
generate_all_techniques
(words)[source]¶ Generate all techniques across the library in one place.
-
namebot.techniques.
get_descriptors
(words)[source]¶ Group words by their NLTK part-of-speech descriptors.
Use NLTK to first grab tokens by looping through words, then tag part-of-speech (in isolation) and provide a dictionary with a list of each type for later retrieval and usage.
-
namebot.techniques.
infixify
(words)[source]¶ Apply a infix technique to a set of words.
Adds all consonant+vowel pairs to all inner matching vowel+consonant pairs of a word, giving all combinations for each word.
- Args:
- words (list) - The list of words to operate on.
- Returns:
- new_arr (list): the updated *fixed words
-
namebot.techniques.
kniferism
(words)[source]¶ Convert a list of words formatted with the kniferism technique.
- Args:
- words (list) - The list of words to operate on
- Returns:
- words (list) - The updated list of words
>>> kniferism(['foo', 'bar']) >>> ['fao', 'bor']
-
namebot.techniques.
make_descriptors
(words)[source]¶ Make descriptor names.
Based from a verb + noun, adjective + noun combination. Examples:
-Pop Cap, -Big Fish, -Red Fin, -Cold Water (grill), etc...Combines VBP/VB/RB, with NN/NNS
-
namebot.techniques.
make_founder_product_name
(founder1, founder2, product)[source]¶ Get the name of two people forming a company and combine it.
- Args:
- founder1 (str): Your founder name 1. founder2 (str): Your founder name 2. product (str): Your product/feature/service name.
- Returns:
- str: The updated name.
>>> make_founder_product_name('chris', 'ella', 'widgets') >>> 'chris & ella widgets'
-
namebot.techniques.
make_misspelling
(words)[source]¶ Misspell a word in numerous ways, to create interesting results.
-
namebot.techniques.
make_name_abbreviation
(words)[source]¶ Will make some kind of company acronym.
eg: BASF, AT&T, A&W Returns a single string of the new word combined.
-
namebot.techniques.
make_name_alliteration
(words, divider=' ')[source]¶ Make an alliteration with a set of words, if applicable.
Examples: java jacket singing sally earth engines ...etc
- Loop through a given array of words
- group by words with the same first letter
- combine them and return to new array
-
namebot.techniques.
make_portmanteau_default_vowel
(words)[source]¶ Make a portmanteau based on vowel matches.
E.g. (ala Brad+Angelina = Brangelina) Only matches for second to last letter in first word and matching vowel in second word.
This defers to the make_vowel function for all the internal magic, but is a helper in that it provides all types of vowel combinations in one function.
-
namebot.techniques.
make_portmanteau_split
(words)[source]¶ Make a portmeanteau, split by vowel/consonant combos.
Based on the word formation of nikon: [ni]pp[on] go[k]aku, which is comprised of Nippon + Gokaku.
We get the first C+V in the first word, then last V+C in the first word, then all C in the second word.
-
namebot.techniques.
make_punctuator
(words, replace)[source]¶ Put some hyphens or dots, or a given punctutation.
Works via :replace in the word, but only around vowels ala “del.ic.ious”
-
namebot.techniques.
make_punctuator_vowels
(words)[source]¶ Helper function that combines all possible combinations for vowels.
-
namebot.techniques.
make_vowel
(words, vowel_type, vowel_index)[source]¶ Primary for all Portmanteau generators.
This creates the portmanteau based on :vowel_index, and :vowel_type.
The algorithm works as following:
It looks for the first occurrence of a specified vowel in the first word, then gets the matching occurrence (if any) of the second word, then determines which should be first or second position, based on the ratio of letters (for each word) divided by the position of the vowel in question (e.g. c[a]t (2/3) vs. cr[a]te (3/5)).
The higher number is ordered first, and the two words are then fused together by the single matching vowel.
-
namebot.techniques.
make_vowelify
(words)[source]¶ Chop off consonant ala nautica if second to last letter is a vowel.
-
namebot.techniques.
palindrome
(word)[source]¶ Create a palindrome from a word.
- Args:
- word (str): The word.
- Returns:
- str: The updated palindrome.
>>> palindrome('cool') >>> 'coollooc'
-
namebot.techniques.
palindromes
(words)[source]¶ Convert a list of words into their palindromic form.
- Args:
- words (list): The words.
- Returns:
- list: The list of palindromes.
>>> palindrome(['cool', 'neat']) >>> ['coollooc', 'neattaen']
-
namebot.techniques.
pig_latinize
(words, postfix='ay')[source]¶ Pig latinize a set of words.
- Args:
- words (list): A list of words. postfix (str, optional): A postfix to use. Default is ay.
- Returns:
- words (list): The updated list.
-
namebot.techniques.
prefixify
(words)[source]¶ Apply a prefix technique to a set of words.
- Args:
- words (list) - The list of words to operate on.
- Returns:
- new_arr (list): the updated *fixed words
-
namebot.techniques.
recycle
(words, func, times=2)[source]¶ Run a set of words applied to a function repeatedly.
It will re-run with the last output as the new input. words must be a list, and func must return a list.
-
namebot.techniques.
reduplication_ablaut
(words, count=1, random=True, vowel='e')[source]¶ A technique to combine words and altering the vowels.
e.g ch[i]t-ch[a]t, d[i]lly, d[a]lly. See http://phrases.org.uk/meanings/reduplication.html.
-
namebot.techniques.
simulfixify
(words, pairs=None, max=5)[source]¶ Generate simulfixed words.
- Args:
words (list) - List of words to operate on. pairs (list, optional) - Simulfix pairs to use for each word.
If not specified, these will be generated randomly as vowel + consonant strings.- max (int, optional): The number of simulfix pairs to generate
- (if pairs is not specified.)
- Returns:
- results (list) - The simulfix version of each word,
- for each simulfix pair.
-
namebot.techniques.
spoonerism
(words)[source]¶ Convert a list of words formatted with the spoonerism technique.
- Args:
- words (list) - The list of words to operate on
- Returns:
- words (list) - The updated list of words
>>> spoonerism(['foo', 'bar']) >>> ['boo', 'far']