[Question]
  [
To each of these nine [confusingly similar](http://en.wikipedia.org/wiki/Semantic_satiation) words, assign a number 1-9 in any way you like:
```
though
through
thorough
Thoreau
throw
threw
trough
tough
troll
```
Write a program that takes in a string. If the input is one of these nine words, output the number you assigned to it. If the input is not one of the words above, the program may do anything (including error or loop forever).
The words are case sensitive, e.g. `Thoreau`, should produce a number from 1-9 but `thoreau` will not necessarily do the same.
## Example
Suppose you assign the numbers as follows:
```
though   9
through  2
thorough 7
Thoreau  6
throw    3
threw    5
trough   4
tough    1
troll    8
```
Then when `tough` is input, `1` should be output.  
When `through` is input, `2` should be output.  
When `throw` is input, `3` should be output.  
. . .  
When `though` is input, `9` should be output.
All other inputs may do anything.
## Details
* Take the input string via stdin or the command line and output to stdout.
* The output may contain a single trailing newline.
* Instead of a program, you may write a function that takes in a string and prints the result normally or returns it.
* **The shortest submission in bytes wins[.](https://www.youtube.com/watch?v=WjzyAHKYJ8M&feature=youtu.be&t=22s)**
  
[Answer]
# CJam, ~~11 9~~ 7 bytes
```
q1b2+B%
```
**How it works**:
We are making use of the fact that the sum of the ASCII codes + 2 moded with 11 gives very nice order of 1 through 9 and then 10 for the nine concerned words. Here is the ordering:
```
through -> 1
thorough -> 2 
tough -> 3 
Thoreau -> 4 
throw -> 5 
threw -> 6 
trough -> 7 
though -> 8 
troll -> 9
```
**Code explanation**:
```
q               e# Read the input
 1b             e# Sum the ASCII code values of all characters in this word
   2+           e# Increment the sum by 2
     B%         e# Mod by 11 and automatically print the mod result at the end
```
*4 bytes saved thanks to user23013*
[Try it online here](http://cjam.aditsu.net/#code=q1bB%25)9e%3C&input=thorough)
[Answer]
# Pyth, 8 chars
```
e%Cz8109
```
Try it online: [Demonstration](https://pyth.herokuapp.com/?code=e%25Cz8109&input=thorough&debug=0) or [Test Suite](https://pyth.herokuapp.com/?code=zFz.zp%22%20%3D%3E%20%22ze%25Cz8109&input=%22Test%20Cases%22%0Athough%0Athrough%0Athorough%0AThoreau%0Athrow%0Athrew%0Atrough%0Atough%0Atroll&debug=0)
I'm using the assignment:
```
though   5
through  9
thorough 4
Thoreau  7
throw    3
threw    2
trough   8
tough    6
troll    1
```
### Explanation:
```
   z       input()
  C        convert to int (convert each char to their ASCII value
           and interprete the result as number in base 256)
 %  8109   modulo 8109
e          modulo 10
```
Btw, I found the magic number 8109 by using this script: [`fqr1 10Sme%CdT.z1`](https://pyth.herokuapp.com/?code=fqr1+10Sme%25CdT.z1&input=though%0Athrough%0Athorough%0AThoreau%0Athrow%0Athrew%0Atrough%0Atough%0Atroll&debug=0). 
[Answer]
# Python 2, ~~92~~ 54 bytes
```
print'K{7j)yE<}'.find(chr(hash(raw_input())%95+32))+1
```
The index string is created with `for word in words: print chr(hash(word)%95+32),`. As pointed out in Jakube's answer, the hash function will give different results depending on Python version. This index string is computed on 64 bit Python 2.7.6.
Longer (92 bytes) but less cryptic answer:
```
print'though through thorough Thoreau throw threw trough tough troll'.find(raw_input())/7+1
```
The programs returns 1-9 for *though through thorough Thoreau throw threw trough tough troll* in that order. When the input is not found, find will return a -1 which conveniently turns into a zero after the `+1`.
[Answer]
# Python 2.7.9 32 bit version, 22 bytes
```
lambda x:hash(x)%78%10
```
Notice, the version is really important here. You will get different results if your using a 64 bit version of Python. Since the `hash` method will compute 64 bit hash values instead of 32 bit. 
The assignment is: 
```
though  => 5   through => 6   thorough => 8
Thoreau => 7   throw   => 3   threw    => 1
trough  => 9   tough   => 4   troll    => 2
```
Try it online: <http://ideone.com/Rqp9J8>
[Answer]
# Pyth, 7 bytes
```
et%Cz31
```
I am using the following asignment:
```
though   8
through  3
thorough 1
Thoreau  5
throw    4
threw    7
trough   6
tough    2
troll    9
```
`Cz` interprets the input as a base 256 number. Then, we take this mod 31, subtract 1, and take the result mod 10. Equivalent pseudocode:
```
((base_256(input()) % 31) - 1) % 10
```
[Demonstration](https://pyth.herokuapp.com/?code=et%25Cz31&input=Thoreau&debug=0), [test harness](https://pyth.herokuapp.com/?code=Fz%2Bz.zet%25Cz31&input=though%0Athrough%0Athorough%0AThoreau%0Athrow%0Athrew%0Atrough%0Atough%0Atroll&debug=0).
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 6 bytes
```
C∑⇧11%
```
[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=C%E2%88%91%E2%87%A711%25&inputs=threw&header=&footer=)
Cjam port.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 6 bytes
```
nH %BÉ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=bkggJULJ&input=InRob3VnaCI) | [Test all words](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=bkggJULJ&footer=VmdXKfo5ICsiPSAiK1U&input=WwoidGhvdWdoIgoidGhyb3VnaCIKInRob3JvdWdoIgoiVGhvcmVhdSIKInRocm93IgoidGhyZXciCiJ0cm91Z2giCiJ0b3VnaCIKInRyb2xsIgpdLW1S)
---
## Explanation
Takes advantage of the fact that, when parsing a base-`n` string to an integer, JavaScript will stop parsing if it encounters a digit greater than `n` and return the result up to that point. By using base-32 here (digits `0-v`) the `w`s in "threw" and "throw" are, essentially, ignored.
```
nH      :Convert from base-32
   %B   :Modulo 11
     É  :Subtract 1
```
Here's a breakdown of the formula applied to each word:
| Input | `nH` | `%B` | `É` |
| --- | --- | --- | --- |
| through | 31738067473 | 2 | 1 |
| tough | 31226385 | 3 | 2 |
| troll | 31318709 | 4 | 3 |
| trough | 1002207761 | 5 | 4 |
| though | 991722001 | 6 | 5 |
| thro*w* | 968568 | 7 | 6 |
| thre*w* | 968558 | 8 | 7 |
| thorough | 1015520459281 | 9 | 8 |
| Thoreau | 31735003486 | 10 | 9 |
---
## JavaScript, 22 bytes
A direct translation - doesn't seem worth posting it separately.
```
f=
U=>parseInt(U,32)%11-1
o.innerText=["through","tough","troll","trough","though","throw","threw","thorough","Thoreau"].map(s=>f(s)+": "+s).join`\n`
```
```
<pre id=o><pre>
```
[Answer]
# Python 2, 27 bytes
```
f=lambda w:int(w,34)%444/46
```
With this assignment:
```
>>> for w in "though through thorough Thoreau throw threw trough tough troll".split(): print f(w),w
...
9 though
7 through
3 thorough
8 Thoreau
2 throw
5 threw
6 trough
1 tough
4 troll
```
Several variations are possible, e.g.
```
f=lambda w:int(w,35)/159%10
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 66 bytes
```
h,k;f(char*s){for(h=33;*s;)h^=*s++;h=strchr(k="(Z5qW]2@H",h)-k+1;}
```
[Try it online!](https://tio.run/##PY7LasMwEEXX0lcMAoNkKZAHWbSKoMt@QKGQxAEjxxljx2olhyyMv91RHs7qHLiXmWtnJ2vHEVWtS24x92kQfek8R7Na6TRogQeTBik1mtB5i57XhvHt@v83W359M4ViVsuFHsaq7eCcVy0XtKfkfgrSq/NF2GWmZx26ywmZiuLf5ib9iXrML6/4@uTxwXd7ondNwwZNCSVxJ/D73woMzHXEBj4ipBSUkD8fo5KzJHxCUuxbpuC5p8oUlHxyITQdxhs "C (gcc) – Try It Online")
[Answer]
# Java 8, ~~53~~ 25 bytes
```
s->(s.chars().sum()+2)%11
```
or
```
s->-~-~s.chars().sum()%11
```
Port of *@Optimizer*'s CJam answer, because it (most likely) cannot be done any shorter in Java..
[Try it online.](https://tio.run/##jc@xDsIgEAbgvU9xaWICMZLUtdE3sItuxuFEtCiFhgONMX32itrZkMDA3cf9cMU7Llyv7PV0G6VBItigtq8CQNug/BmlguZz/BZAsm3w2l6AeJ2KQ9ppUcCgJTRgYQUjLdaMhGzRE@OCYsf4fMlnVTXWP97Ho0l8unV3@gRdCp1G7w/If4HbJwXVCReD6FMnGMuskKwMrXfx0pb8@4Z/zmXCLLVL4xTGjFjvHjlKZajsn2Yx74yZ1FAM4xs)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
OS+2%11
```
[Try it online!](https://tio.run/##y0rNyan8/98/WNtI1dDw////SiUZRfml6RlKAA "Jelly – Try It Online")
Boring Jelly port of the fantastic CJam answer.
]