Using the knowledge in computational language in python it is possible to write a code that using this technique, the word tar is the list of letters, [‘a’, ‘r’, ‘t’], is hashed and the word ‘tar’ is stored.
<h3>Writting the code:</h3>
<em>from nltk.corpus import words</em>
<em>def func(wrd,all_words):</em>
<em>letters = {}</em>
<em>hashed = 0</em>
<em>a = 'abcdefghijklmnopqrstuvwxyz'</em>
<em>for letter in range(len(a)):</em>
<em>letters[a[letter]] = letter</em>
<em>if wrd in words.words():</em>
<em>for i in wrd:</em>
<em>hashed += letters[i]</em>
<em>all_words[wrd] = hashed</em>
<em />
<em>return all_words</em>
<em />
<em>if __name__ == "__main__":</em>
<em>t = int(input())</em>
<em>all_words = {}</em>
<em>for i in range(t):</em>
<em>word = input()</em>
<em>print(func(word,all_words))</em>
See more about python at brainly.com/question/18502436
#SPJ1