Package: wordlexord
words-serial-numberThis is a python package for havingfunwith words ordered bylength andthenlexicographically.(eg:a, b, c, d, e, ..., x, y, z, aa, ab, ac, ..., ax, ay, az, ba, bc, bdand so on...)loreEach word has it's serial number. For example, if we use standart english alphabet"abcdefghijklmnopqrstuvwxyz"and we want to find the8514th word in this alphabet - we can just call theget_word_by_numbermethod and get the answer - it'slol.We can do the same thing in other direction. If we want to find the serial number of the wordjesus, we can call theget_word_numberand recieve the number: it's4671049.There are alsootherhelpful methods:get_words_numbers_in_sentence- as it says, we recieve a list of words' serial numbers from a sentence (string). ("lol lmao"->[8514, 219741])nums_to_words- same, but in other direction ([235476151, 18091001]->["sugoma", "amogus"])words_range- same as python range, but with words. (1000, 1500, 100->generator("all", "aph", "atd", "awz", "bav"))infinite_generation- it just prints all the words starting with the first word in an infinite loop.installationpip install wordlexordquick startfromword_lexordimport(lang,get_word_by_number,get_word_number,get_words_numbers_in_sentence)eng_lower=lang.ALPHABETS["EN"]["lower"]jesus_number=get_word_number("jesus",eng_lower)print(f"Serial number of the word\"jesus\"is{jesus_number}")# Serial number of the word "jesus" is 4671049some_word=get_word_by_number(18091001,eng_lower)print(f"The word by number{18091001}is{some_word}")# The word by number 18091001 is amogussentence="hi there! i am using telegram"print(get_words_numbers_in_sentence(sentence,eng_lower))# [217, 9283981, 9, 39, 9936895, 162325779031]docsalphabetsSince order can be determined on an alphabet, we will need the alphabet. An alphabet is a string, where each symbol is a letter of the alphabet. There are few alphabets available in the package, they are located inlangmodule.fromword_lexordimportlangeng_lower=lang.ALPHABETS["EN"]["lower"]print(eng_lower)# "abcdefghijklmnopqrstuvwxyz"Or you can just use a string with random symbols:abc="12345qwertyuiop"We will use some alphabets further: english lower and russian lower.methodsget_word_number(word, alphabet: str) -> int- get theword's number inalphabet.e.g:get_word_number("sus", eng_lower)is13409.get_word_by_number(num: int, alphabet: str) -> str- get the word by thenuminalphabet.e.g:get_word_by_number(235476151, eng_lower)is"sugoma".get_words_numbers_in_sentence(sentence: str, alphabet: str) -> List[int]- get each word's number insentence. Words are separated with the space symbol. Each symbol that is not present in 'alphabet' is replaced with the space symbol.e.g:get_words_numbers_in_sentence("i love bioinformatics!", eng_lower)is[9, 221629, 5877569419735112053]. As you can see, the exclamation mark is didn't affect the result.nums_to_words(nums: List[int], alphabet: str) -> List[str]- convert each num innumsinto word byget_word_number.e.g:nums_to_words([9, 221629, 5877569419735112053], eng_lower)is['i', 'love', 'bioinformatics'].words_range(alphabet: str, *args: List[int]) -> str- recieve a word generator.argsworks like range() function. It takes from 1 to 3 arguments.e.g:forwordinwords_range(eng_lower,1,100,20):print(word,eng=" ")# a u ao bi ccdecimal_to_base(num, base: int) -> list[int]- convertnumfrom decimal tobasenumber system without zeros.e.g:decimal_to_base(1234, 2)is[1, 1, 2, 2, 1, 2, 1, 2, 1, 1].convert_nums_to_letters(nums: List[int], alphabet: str) -> str- replacesnumswith list of chars and concatenates them.e.g:convert_nums_to_letters([1, 2, 3], eng_lower)is"abc".tododocsreadme ruspoetry