[Question]
  [
Convert a string containing digits as words into an integer, ignoring leading zeros.
# Examples
* `"four two"` -> `42`.
* `"zero zero zero one"` -> `1`.
# Assumptions
Submissions can assume that:
1. The input string is comprised of space-separated digit words.
2. All words are valid (in the range "zero".."nine") and lowercase. Behaviour for empty input is undefined.
3. The input string always represents an unsigned number within the range of `int` and is never an empty string.
# Scoring
Answers will be scored in bytes with fewer bytes being better.
  
[Answer]
# [PHP](https://php.net/), 74 bytes
```
foreach(explode(' ',$argn)as$w)$n.='793251_8640'[crc32($w)%20%11];echo+$n;
```
[Try it online!](https://tio.run/##RY1LCsIwFAD3PUUoKUnwQz9@ieLOS6hISJ9GkPdCklLx8Na6cjMMzGK888Pu4EfeKICxTsLLP6kFKZiYchPuqEzkveI434v1tqmX1XWzWpTiZINtajmmoi6LqrposI4mHPXwE5afMddZhxGS5Kj0OOgCSz1lbwjE/iCED/n0IIzD7PgF "PHP – Try It Online")
Tried to get a solution which doesn't copy existing answers. I get cyclic redundancy checksum polynomial of 32-bit lengths ([crc32](https://www.php.net/manual/en/function.crc32.php)) for each word and then do a mod 20 and mod 11 on it to get mixed up unique values from 0 to 10 (missing 6) for each digit. Then using that unique value I find the actual digit.
```
| Word  | CRC32      | %20 | %11 | Equivalent digit |
|-------|------------|-----|-----|------------------|
| zero  | 2883514770 | 10  | 10  | 0                |
| one   | 2053932785 | 5   | 5   | 1                |
| two   | 298486374  | 14  | 3   | 2                |
| three | 1187371253 | 13  | 2   | 3                |
| four  | 2428593789 | 9   | 9   | 4                |
| five  | 1018350795 | 15  | 4   | 5                |
| six   | 1125590779 | 19  | 8   | 6                |
| seven | 2522131820 | 0   | 0   | 7                |
| eight | 1711947398 | 18  | 7   | 8                |
| nine  | 2065529981 | 1   | 1   | 9                |
```
Another 74 bytes CRC32 alternative using `%493%10`: [Try it online!](https://tio.run/##RcxLC4JAFAXgvb/iIiMqPdC0h1i0609UC7GrMxD3DjPjg358pqs2HwfO4Wipp/NVzzZssKplhKN@8wujEMK1qExLcWXFEAvaXsL8dMwO@2KXpOG9NnW2i@YmyIssSJNnibXklaByWgL4D/JLryOLLhIUlxMTghsYnDSI0HBnoFE9glUjWOyRAFUrHZCahx807C3An/ngy9opJjttbj8 "PHP – Try It Online")
Another 74 bytes CRC32 alternative using `%2326%11`: [Try it online!](https://tio.run/##RczdCoJAEAXge59ikBWVfkgtKyy66yUqQmx0F2Jm2V1/6OEzverm48A5HC31eLroyZoNlpWMcNBvfmEUQrgUpWkoLq3oY0Hr8zPJjoftLt9v0ltlqiyNpiJIszQPkuRRYCV5IagY5wD@nfzCa8miiwTFxciE4HoGJw0i1NwaqFWHYNUAFjskQNVIB6Sm4QcNezPwZzr4snaKyY6r6w8 "PHP – Try It Online")
---
# [PHP](https://php.net/), 74 bytes
```
foreach(explode(' ',$argn)as$w)$n.=strpos(d07bfe386c,md5($w)[21]);echo+$n;
```
[Try it online!](https://tio.run/##RY1LCsIwFAD3PUUogSZYxQ9VIYo7L6EuYvJqBH0vJCkVD2@MKzfDwCzGO593B1/YUwBtnICXf5AF0bCm5TrcUOrIR8lxto8peIrCzjfXHlbbtWmfthMlnpaLi1RgHE04qvwTVp@xVtWAEZLgKFUZDIGlkao3BGJ/EMKHfLoTxjw9fgE "PHP – Try It Online")
Another alternative with same length, takes 22nd character in the `md5` of the word (only character which gives a unique value for each word) and then uses that character to map to a digit.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~71~~ 70 bytes
-1 thanks to [ovs](https://codegolf.stackexchange.com/users/64121) (use `find` in place of `index`)
```
lambda s:int(''.join(`'rothuvsein'.find((w*3)[6])`for w in s.split()))
```
**[Try it online!](https://tio.run/##FYtBDgIhDAC/0hvggYMmHkx8iZrsmi1Ss7YEuqB@HvE2mcykj0bhfQ/na1/n132ZoZyI1Rrjn0JsJ5NF41YLEhsfiBdr2@7gLsebm4JkaEAMxZe0klrnXE95/BAscdr@pptAFUGbQMGKI6Y3aMyIEGTLIIyA9IgKTAO/mMX8AA "Python 2 – Try It Online")**
[Answer]
# JavaScript (ES6), ~~70 67 66~~ 62 bytes
*Saved 3 bytes thanks to @ovs*
```
s=>+s.replace(/\w+ ?/g,s=>'2839016547'[parseInt(s,36)%204%13])
```
[Try it online!](https://tio.run/##bY29DoIwFEZ3n@IupG1A/kUd0NlnUIcGb6GGtKStYHz5inEwIS7fcHLynTsfuW2MHNxa6Rt6UXtbH0IbGxx63iBNLlMIx6SNZkzyXbFPs2pTbsl54MbiSTlqo6JiQZ6WQVZcmW@0srrHuNctFZQI/TDgJg1aIbzQaMLYauF8MPxmNv9ISs4HKNvOgcURFVj5BCFHhG@iM4jLkH8D "JavaScript (Node.js) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~19~~ 17 bytes
```
Ḳµ7ị“*;nÄƲ]³Ṙ»i)Ḍ
```
A monadic Link accepting a list of characters which yields an integer.
**[Try it online!](https://tio.run/##AVsApP9qZWxsef//4biywrU34buL4oCcKjtuw4TGsl3Cs@G5mMK7aSnhuIz///9maXZlIHR3byBzZXZlbiBzaXggdGhyZWUgZm91ciBvbmUgZWlnaHQgbmluZSB6ZXJv "Jelly – Try It Online")**
Pretty much a port of my Python 2 answer.
---
Previous
```
ḲŒ¿€i@€“©¥q£½¤MÆÑ‘Ḍ
```
[Try it online!](https://tio.run/##y0rNyan8///hjk1HJx3a/6hpTaYDkHjUMOfQykNLCw8tPrT30BLfw22HJz5qmPFwR8/////TMstSFUrK8xWKU8tS8xSKMysUSjKKUlMV0vJLixTy81IVUjPTM0oU8jKBzKrUonwA "Jelly – Try It Online")
There is ~~quite possibly~~ a shorter way, but this is a way that first came to mind.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~35~~ 32 bytes
```
{+uniparse 'SP'~S:g/<</,DIGIT /}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/Wrs0L7Mgsag4VUE9OEC9LtgqXd/GRl/HxdPdM0RBv/a/NVdxYqWCHlBxWn6RQk5mXmrx/7T80iKFkvJ8rqrUonwFMJGflwoA "Perl 6 – Try It Online")
### Explanation
```
{                              }  # Anonymous block
                S:g/<</,DIGIT /   # Insert ",DIGIT " at
                                  # left word boundaries
           'SP'~  # Prepend 'SP' for space
  uniparse  # Parse list of Unicode names into string
 +  # Convert to integer
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~18~~ 16 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
#ε6è}.•ƒ/ÿßÇf•Åβ
```
[Try it online.](https://tio.run/##yy9OTMpM/f9f@dxWs8MravUeNSw6Nkn/8P7D8w@3pwE5h1vPbfr/vyq1KF@hJKMoNVWhOLNCoaQ8X6E4tSw1TyE1Mz2jRCEvMy9VIR@IIUrSMsuARH5pEVgMiAE)
**Explanation:**
```
#                 # Split the (implicit) input-string on spaces
 ε  }             # Map each string to:
  6è              #  Get the character at 0-based index 6 (with automatic wraparound)
     .•ƒ/ÿßÇf•    # Push compressed string "rothuvsein"
              Åβ  # Convert the characters from custom base-"rothuvsein" to an integer
                  # (after which the top of the stack is output implicitly as result)
```
[See this 05AB1E tip of mine (section *How to compress strings not part of the dictionary?*)](https://codegolf.stackexchange.com/a/166851/52210) to understand why `.•ƒ/ÿßÇf•` is `"rothuvsein"`.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 89 bytes
```
i,n;f(char*w){for(i=n=0;n=*w%32?n^*w:(i+=n-2)&&!printf(L"8 0  72 3  59641"+n%17),*w++;);}
```
[Try it online!](https://tio.run/##TYrLCoJAFED3fsVtQJnxAT4qq2HoB/qGQGRG76JrjOZE4rdblIs2h8Ph1ElT18uCMUnD67ayoROT6SxHRSqVpELnF/mZrqE7cYwUJbkIgs3dIg2GX9gBUoAyhwJgd9xvMxaRn5UiDl0USSHn5fPBrUICLibPM5y9tO3gi470Twa3lqG1em1fmO5hweCooccn9HrUBBqbdgBC@huZkJ43L28 "C (gcc) – Try It Online")
Thanks to @Ceilingcat smartest tricks : 
```
- printf instead of putchar.   
- !printf instead of printf()&0. 
- And wide char !
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~107~~, ~~91~~, ~~77~~, ~~90~~, 74 bytes
-16 bytes by Sriotchilism O'Zaic
+13 bytes to remove leading zeroes
-16 bytes using `find` and a more clever indexing, but now it's basically a rip-off of the [Python 2 version](https://codegolf.stackexchange.com/a/193364/)...
```
lambda s:int(''.join(str('rothuvsein'.find((w*3)[6]))for w in s.split()))
```
[Try it online!](https://tio.run/##ZY/BDoIwDIbvPEVv3QzhQuKBxCdBDhg6qcGOrAPUl58Ojl7a9MvXv@n8jqOXOrnLNU398zb0oA1LNIjVw7MYjcFg8HFcViUWrBzLYMx2qm177qx1PsAGLKCVzhNHY60tUqaaaYsfCh5LQC@UWx5hL39gN6FE55cAcdu3hIWA@D5GUFrpd4Zf4HglOKwxEGU3px0BXVPAHPILzqi16Qs "Python 3 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~17~~ 16 bytes
```
•D±¾©xWÄ0•I#HèTβ
```
[Try it online!](https://tio.run/##yy9OTMpM/f//UcMil0MbD@07tLIi/HCLAZDrqexxeEXIuU3//1elFuUr5OelKpSU5yuUZBSlpiqk5ZcWKaRllqUqFGdWKBSnlqXmKaRmpmeUKORl5qUCAA "05AB1E – Try It Online")
Perfect tie with [the other 05AB1E answer](https://codegolf.stackexchange.com/questions/193357/convert-a-string-of-digits-from-words-to-an-integer/193395#193395), but using a completely different approach.
```
•D±¾©xWÄ0•               # compressed integer 960027003010580400
          I#             # split the input on spaces
            H            # convert each word from hex (eg "one" => 6526)
             è           # index (with wrap-around) into the digits of the large integer
              Tβ         # convert from base 10 to integer
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~46~~ 45 bytes
```
\w+
¶$&$&$&
%7=T`r\ot\huvs\ein`d`.
\D
^0+\B
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wP6Zcm@vQNhU1EORSNbcNSSiKyS@JySgtK45JzcxLSEnQ44px4eKKM9COceL6/z8tv7RIoaQ8n6sqtShfAUHk56Vy5WXmpSqkZqZnlCgUp5al5ikUZ1YopGWWpSpAdGUUpaaC9IIUg3UBAA "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
\w+
¶$&$&$&
```
Put each word on its own line and triplicate it.
```
%7=T`r\ot\huvs\ein`d`.
```
Transliterate the 7th character of each line using @UnrelatedString's string.
```
\D
```
Delete all remaining non-digit characters.
```
^0+\B
```
Delete leading zeros (but leave at least one digit).
Previous 46-byte more traditional solution:
```
T`z\wuxg`E
on
1
th
3
fi
5
se
7
ni
9
\D
^0+\B
```
[Try it online!](https://tio.run/##Rcs9CgIxFEXh/q7iNYJgo4iIrShuYMogsbiZvOYFkswPs/noaGFzqvNlVrVX22wfvnV@cdMw9/6OZDigRhwRFCcU4gxTXOBuwHO/c1e0FtKQpU4JC3OSf5LxMxuF2scqhSNNis4SdKT8VMzkatf5q94 "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
T`z\wuxg`E
```
The words `zero`, `two`, `four`, `six` and `eight` uniquely contain the letters `zwuxg`. Transliterate those to the even digits.
```
on
1
th
3
fi
5
se
7
ni
9
```
For the odd digits, just match the first two letters of each word individually.
```
\D
```
Delete all remaining non-digit characters.
```
^0+\B
```
Delete leading zeros (but leave at least one digit).
[Answer]
# x86 machine code, 46 bytes
Hexdump:
```
57 53 33 c0 33 ff f6 01 0f 75 15 6a 0a 5b 99 f7
f3 6b ff 0a 03 fa 33 c0 38 01 75 0f 97 5b 5f c3
69 c0 26 2b aa 6e 32 01 c1 e8 02 41 eb d8
```
It's a `fastcall` function - receives a pointer to the string in `ecx`, and returns the result in `eax`.
The hashing function multiplies by a magic number `1856645926`, does a `XOR` with input byte, and shifts right by 2 bits.
Saving and restoring noclobber registers (`edi` and `ebx`) took 4 bytes, but I didn't find a more efficient way to implement this. Storing the constant 10 in `ebx` was particularly annoying!
Disassembly with corresponding code bytes:
```
57                   push        edi  ; edi = result
53                   push        ebx  ; we use ebx to store the constant 10
33 C0                xor         eax,eax  
33 FF                xor         edi,edi  
    myloop:
F6 01 0F             test        byte ptr [ecx],0Fh  ; check for end of word
75 15                jne         myhash
6A 0A                push        0Ah  
5B                   pop         ebx  
99                   cdq              ; prepare 64-bit dividend in edx:eax
F7 F3                div         eax,ebx  ; find the remainder of division by 10
6B FF 0A             imul        edi,edi,0Ah
03 FA                add         edi,edx  ; update the result
33 C0                xor         eax,eax  ; reset the hash temporary variable
38 01                cmp         byte ptr [ecx],al  ; check for end of input (here al=0)
75 0F                jne         mycontinue
97                   xchg        eax,edi  ; set the return register
5B                   pop         ebx  ; restore registers
5F                   pop         edi  ; restore registers
C3                   ret  
    myhash:
69 C0 26 2B AA 6E    imul        eax,eax,6EAA2B26h  ; hashing...
32 01                xor         al,byte ptr [ecx]  ; hashing...
C1 E8 02             shr         eax,2  ; hashing...
    mycontinue:
41                   inc         ecx  ; next input byte
EB D8                jmp         myloop
```
Equivalent C code:
```
int doit(const char* s)
{
    int result = 0;
    unsigned temp = 0;
    while (true)
    {
        int c = *s++;
        if ((c & 15) == 0)
        {
            temp %= 10;
            result = result * 10 + temp;
            temp = 0;
            if (c == 0)
                break;
            else
                continue;
        }
        temp *= 1856645926;
        temp ^= c;
        temp >>= 2;
    }
    return result;
}
```
[Answer]
# ARM Thumb-2 (manual `rothuvsein`, no div, no libc) 70 bytes
Machine code:
```
b5f0 2100 2420 f000 f816 0032 18c5 3b03
bf18 f1c3 0303 5cc4 a004 f000 f80c 240a
fb01 3104 1c68 2a00 d1ec bdf0 6f72 6874
7675 6573 6e69 f07f 0300 1c5b 5cc6 b10e
42a6 d1fa 4770
```
Assembly:
```
        .syntax unified
        .arch armv6t2
        .thumb
        .globl _strtoint
        .thumb_func
_strtoint:
        push    {r4-r7, lr}
        movs    r1, #0
.Lstrtoint_loop:
        movs    r4, #' '
        bl      _strfind
        movs    r2, r6
        adds    r5, r0, r3
        subs    r3, #3
        it      ne
        rsbne   r3, #3
        ldrb    r4, [r0, r3]
        adr     r0, .Lrothuvsein
        bl      _strfind
        movs    r4, #10
        mla     r1, r1, r4, r3
        adds    r0, r5, #1
        cmp     r2, #0
        bne     .Lstrtoint_loop
.Lstrtoint_loop_end:
        pop     {r4-r7, pc}
        @ naturally 4-byte aligned
        @ note: this is not null terminated - we blindly assume a match
.Lrothuvsein:
        .ascii "rothuvsein"
        @ naturally 2-byte aligned
        .thumb_func
_strfind:
        movs    r3, #-1
.Lstrfind_loop:
        adds    r3, r3, #1
        ldrb    r6, [r0, r3]
        cbz     r6, .Lstrfind_loop_end
        cmp     r6, r4
        bne     .Lstrfind_loop
.Lstrfind_loop_end:
        bx      lr
```
### Explanation
Yet another port of the `rothuvsein` method, but this seems to be the first one in assembly. It is also done manually without the support of libc or fancy useless CISC instructions like `repne scasb`. Just plain, barebones RISC. That means that it is longer than other assembly languages.
Unlike my previous entries, I am a little more flexible with the calling convention.
While the input string (null terminated) is in `r0` just like it would be in C, the output is a 32-bit integer in `r1` instead of the traditional `r0`.
It can still be wrapped in C like so, since `r1` is still used for 64-bit integers:
```
extern uint64_t _strtoint(const char *str);
uint32_t strtoint(const char *str)
{
    return (uint32_t)(_strtoint(str) >> 32);
}
```
Regardless of whether I care about the calling convention, I am going to have to do something with the link register so I can call my subroutine, so might as well `push` the callee-saved registers and remain mostly in line with the calling convention.
```
        .globl _strtoint
        .thumb_func
_strtoint:
        push    {r4-r7, lr}
```
Initialize our accumulator/output variable to 0.
```
        movs    r1, #0
```
Call our internal subroutine to find the end of the word.
`r3` will have the length of the word, and `r6` will have the last byte read. I will explain `_strfind` later.
```
.Lstrtoint_loop:
        movs    r4, #' '
        bl      _strfind
```
We save a copy of the last byte read for later to tell if we reached the null terminator.
```
        movs    r2, r6
```
Put the pointer to the string (advanced to the space) in `r5`.
```
        adds    r5, r0, r3
```
Here is the trickiest part: **One does not simply `str+str+str` in assembly.** We need to find the index.
Specifically, if we plot it out:
```
oneoneone
      ^
fourfourfour
      ^
sevensevenseven
      ^
```
We can turn it into this:
```
switch (strlen(str)) {
case 3: return str[0];
case 4: return str[2];
case 5: return str[1];
}
```
It can be done as `6 % strlen(str)`, but that is division. I can do better.
I could do a lookup table, but there is a better solution than that:
Remember that `r3` is essentially `strlen(str)`.
We can do this:
```
        subs    r3, #3
        it      ne
        rsbne   r3, #3 @ note: rsb = Reverse SuBtract
```
The equivalent C:
```
if ((len -= 3) != 0)
{
    len = 3 - len;
}
```
This works perfectly:
```
3 - 3       = 0
3 - (4 - 3) = 2
3 - (5 - 3) = 1
```
Now, we load the byte from the string at our offset...
```
        ldrb    r4, [r0, r3]
```
...then call `_strfind` with the `rothuvsein` lookup table to find it.
```
        adr     r0, .Lrothuvsein
        bl      _strfind
```
Now, we add the length to our accumulator times 10;
```
        movs    r4, #10
        mla     r1, r1, r4, r3 @ r1 = r1 * 10 + len
```
Take the copy of the string we made in `r5`, advance it past the space, and put it in `r0` for the next iteration.
```
        adds    r0, r5, #1
```
Then, loop if we are not at a null terminator:
```
        cmp     r2, #0
        bne     .Lstrtoint_loop
```
Finally, return in `r1` by popping the link register holding the return address into the program counter (along with restoring the other registers I saved).
```
.Lstrtoint_loop_end:
        pop     {r4-r7, pc}
```
\_strfind subroutine
`_strfind` is the real workhorse here.
C users will find it similar to `strcspn` or `strchr`.
It is called with the null terminated string to search in `r0` and the byte to find in `r4`.
It will return the index of the match (or null terminator) in `r3` and the last byte read in `r6`.
First, initialize our counter at -1.
```
_strfind:
        movs    r3, #-1
```
On each iteration, increment the counter..
```
.Lstrfind_loop:
        adds    r3, r3, #1
```
Then, load `str[counter]` into `r6`
```
        ldrb    r6, [r0, r3]
```
Then loop unless `r6` is `\0` or if it matches `r4`.
```
        cbz     r6, .Lstrfind_loop_end
        cmp     r6, r4
        bne     .Lstrfind_loop
```
When we find it, return back to `_strtoint`.
```
.Lstrfind_loop_end:
        bx      lr
```
[Answer]
# [C++ (gcc)](https://gcc.gnu.org/), ~~478~~ ~~218~~ 142 bytes
-(a lot) thanks to Jo King
```
int f(string s){char c[]="N02K8>IE;6";int i=0,n=0;while(s[i]){n=n*10-1;while((s[i]^s[i+1])+47!=c[++n%10]);while(s[i++]!=' '&&s[i]);}return n;}
```
[Try it online!](https://tio.run/##RZDBaoRADIbvPkV2S3e17sJYSlsY3VsPpdAXEBdkjBrQKDPjbqn47HYUoZeQfEl@/kT1/blSan4gVs1QIMTUGasxby/eYIgr4LxF0@cKwdhCzsQWSt@NLD0TjKrONag0S/bf4vnr/fL5IV/3cpmiRJw4EfJeU4O@SSkLRk74KRLnaIMrvboQRlkQvrztEpWGIT9GIgv@98Iw2yVHOB4Oq4icNNpBM7CcVjttTuwH3ugBbL4aYpSurNAuqa@ITysMpOew6gYLcezuWNmSIhfNsrFJC@lN8y/qDjpGsPcObK0RoewGDSXd3DPoBwzekAGpqi2wU/oD "C++ (gcc) – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 13 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
¸mg6 ì`Î¨uv 
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=uG1nNiDsYM6odXagiA&input=Inplcm8gb25lIHR3byB0aHJlZSBmb3VyIGZpdmUgc2l4IHNldmVuIGVpZ2h0IG5pbmUi)
Looks like everyone else beat me to the same idea - could've saved myself the hassle of writing a script to brute force the optimal string for compression, only to find that, up to index `1,000,000` (it was early, I hadn't had my caffeine yet!), "rothuvsein" is the *only* possible string!
```
¸mg6 ì`...     :Implicit input of string
¸              :Split on spaces
 m             :Map
  g6           :  Character at index 6 (0-based, with wrapping)
     ì         :Convert from digit array in base
      `...     :  Compressed string "rothuvsein"
```
The compressed string contains the characters at codepoints `206`, `168`, `117`, `118`, `160` & `136`.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~63 bytes~~, ~~52 bytes~~, 50 bytes
```
p $*.map{|d|'rothuvsein'.index (d*3)[6]}.join.to_i
```
-2 thanks to [value ink's](https://codegolf.stackexchange.com/users/52194/value-ink) tip
[Answer]
# T-SQL, 110 bytes
```
SELECT 0+STRING_AGG(CHARINDEX(LEFT(value,2),'_ontwthfofisiseeini')/2,'')
FROM STRING_SPLIT((SELECT*FROM i),' ')
```
Line break is for readability only.
Input is taken via table \$i\$, [per our IO rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/5341#5341). I could have saved 14 bytes by pre-populating a string variable, but that's only allowed if the language has no other input methods.
Explanation:
1. `STRING_SPLIT` takes the input string and separates it at the spaces
2. `CHARINDEX` takes the first 2 characters and returns the (1-based) position in the string `'_ontwthfofisiseeini'`. `'ze'` for zero is not in the string and returns 0 for "not found". The underscore ensures we only get multiples of two.
3. Divide by 2 to get the final numeral
4. `STRING_AGG` smashes the digits back together with no separator
5. `0+` forces an implicit conversion to INT and drops any leading zeros. `1*` would also work.
[Answer]
# Kotlin, 83 bytes
```
fun String.d()=split(' ').fold(""){a,b->a+"rothuvsein".indexOf((b+b+b)[6])}.toInt()
```
+1 byte if you wanna support longs with `toLong()`
Same rothuvsein trick as the others, saving some precious bytes thanks to kotlin's nice `toInt()` and `fold()`. I just can't shake the feeling that some more bytes can be shaved off though...
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~20~~ ~~18~~ ~~17~~ 16 bytes
```
Ḳ7ị“"c tẠ;Ḅ»iƲ€Ḍ
```
[Try it online!](https://tio.run/##y0rNyan8///hjk3mD3d3P2qYo5SsUPJw1wLrhztaDu3OPLbpUdOahzt6/v//r1SVWpSvUFKer5CWX1qkUJxZoZCamZ5RopCXmZeqUJxalpqnkA9kpWWWpSpA1GYUpaZCSCUA "Jelly – Try It Online")
-2 bytes from running ["rothuvsein"](https://tio.run/##SypKTM6ozMlPN/r/X6kqtShfIT8vVaGkPF@hJKMoNVUhLb@0SCEtsyxVoTizQqE4tSw1TyE1Mz2jRCEvE6jQkSBQeriz/VFTY1Xmo84FpzY83NX5qGvp//8A) through [user202729's string compressor](https://codegolf.stackexchange.com/a/151721/85334).
-1 byte from stealing Jonathan Allan's zero-free enklact string, and putting it in a marginally differently structured program.
-1 byte because I actually kind of understand Jelly's dictionary-based string compression now
```
Ḳ                   Split the input on spaces,
             Ʋ€     for each word
            i       find the first 1-based index (defaulting to 0)
   “"c tẠ;Ḅ»        in "othuvseine"
 7ị                 of the element at modular index 7,
               Ḍ    and convert from decimal digits to integer.
```
I must admit, I'm disappointed I couldn't get a length reduction from `othuvseinfeld`.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 45 bytes
```
+*.words>>.&{+(1...*.uniname.comb(.uc))}.chrs
```
[Try it online!](https://tio.run/##HcsxCoQwEAXQ3lNMJRrhwzbbLHqXbJywgsnIZIOoePYoNq97C@v8LmGj2lNfOoNVdEzDgPromhcAgxynaAPDSfg2yK5tT7ifpvKpkt0I9/SiNE@RU/GSlf6rVDur0INEvgA "Perl 6 – Try It Online")
[Answer]
# [Clean](https://github.com/Ourous/curated-clean-linux), 88 bytes
```
import StdEnv,Text
$s=toInt{#i\\n<-split" "s,c<-:"rothuvsein"&i<-['0'..]|c==(n+n+n).[6]}
```
[Try it online!](https://tio.run/##RY07C8IwFEZ3f0WI4gPb4uQgzaaD4CDo1nYIaaqB5N6S3Pr2rxsLDvLBgbOcT1ktITqsO6uZkwaicS16YgeqN3BJjvpGg1EQhFug59CUJeRpaK0hznhIVJ6uuEc6d5egDfCxydNisphkWfVSQkxh3m@WFcvqHQ8k@67oX1o2YgVvsPOMrsgTxh/aI/sDQfMqflRj5SnEdLuL6ztIZ9RP9lZSg959AQ "Clean – Try It Online")
Heavily based on [Jonathan Allan's answer](https://codegolf.stackexchange.com/a/193364/58563).  
Uses a comprehension for indexing instead of `indexOf` / `elemIndex`.
[Answer]
# [J](http://jsoftware.com/), 38 bytes
```
('b\e~mjPxw['i.[:u:70+1#.15|3&u:)&>@;:
```
[Try it online!](https://tio.run/##Pcu9CsIwFIbhvVfxodBjUUOLFCGiCIKTg7jWSTkxKZhA@ouItx5tB4d3eeEpw0SQwlaCsEAK@WspcLicjmFGtyt/nuW57woyopCNXKfzbCqy/L2KG5nEu/1GhiSK@K4dFOjF3sFZRt051NozQ7nGQ5mWUZkeFbdsweaha1hjmf50ECMf9ggofAE "J – Try It Online")
[Answer]
# VBA, 160 bytes
```
Function e(s)
s = Split(s, " ")
For i = LBound(s) To UBound(s)
s(i) = Int((InStr("ontwthfofisiseeini", Left(s(i), 2)) + 1) / 2)
Next
e = Val(Join(s, ""))
End Function
```
Matches the first two characters in a string, zero excluded.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 19 bytes
```
Ｉ⍘⭆⪪Ｓ §ι⁶rothuvsein
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwymxODW4BMhP14BQvokFGsEFOZklGp55BaUlUDlNHQUlBSUg6VjimZeSWqGRqaNgpgkSLcovySgtK07NzFPS1NS0/v8/Lb@0SKGkPJ/rv25ZDgA "Charcoal – Try It Online") Link is to verbose version of code. Port of @KevinCruijssen's 05AB1E answer. Explanation:
```
    Ｓ               Input string
   ⪪                Split on spaces
  ⭆                 Map over words and join
       ι            Current word
      §             Cyclically indexed
        ⁶           Literal `6`
 ⍘       rothuvsein Custom base conversion
Ｉ                   Cast to string for implicit print
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 48 bytes
```
+-join($args|%{'rothuvsein'.indexof(($_*3)[6])})
```
[Try it online!](https://tio.run/##BcFbCoAgEADAyxhqUT9Bl4mIoDUNcWPVjB5n32YOLEDRgvfMTbujC0ostMW3eiRhsvmM4ILsXFjhQqOUmOtej8OkP83MNxByKsgGM/0 "PowerShell – Try It Online")
Uses the same `rothuvsein` trick as others, thanks to Jonathan Allan. Expects input arguments via splatting, which on TIO manifests as separate command-line arguments.
[Answer]
# [sed -re](https://www.gnu.org/software/sed/), 78 bytes
```
s/three/3/g;s/five/5/g;s/\w\w(\w)\w*/\1/g;s/ //g;y/eouxvgnr/12467890/;s/^0*//
```
[Answer]
## Windows Batch, 169 bytes
```
@setlocal enabledelayedexpansion
@set z=zeontwthfofisiseeini
:a
@set b=%1
@for /l %%c in (0,2,18)do @if "!b:~0,2!"=="!z:~%%c,2!" set/aa=a*10+%%c/2&shift&goto a
@echo %a%
```
[Answer]
# [K (ngn/k)](https://bitbucket.org/ngn/k), 27 bytes
```
10/"rothuvsein"?(*|7#)'" "\
```
[Try it online!](https://tio.run/##XYxBCsIwEEWvMoyLtoJUV4IuvIjbn2YQZiBJo4h3j6ahFNwMw@e99zjopKW4y@k4crDk5xwhyrd@/znvho6J78V1PTubA6Wn8ZXfCEbbMcU6/t7KUPIBoEVxkkFRXhSRoQSZfCKVzWlsJar5T7Vky9XS0rS281C@ "K (ngn/k) – Try It Online")
Another port of [Kevin Cruijssen's 05AB1E answer](https://codegolf.stackexchange.com/a/193395/98547).
* `" "\` split input on spaces
* `(*|7#)'` take the last character of each word (repeated to be of length seven)
* `"rothuvsein"?` find index of character in "rothuvsein" (i.e. the seventh character of "zero" repeated is "r", which is at index 0)
* `10/` convert from a list of digits to a decimal number
[Answer]
# [Scala](http://www.scala-lang.org/), ~~66~~ ~~64~~ 62 bytes
```
_.split(" ").map("rothuvsein"indexOf _.*(3)(6)).mkString.toInt
```
[Try it online!](https://tio.run/##nVFLS8NAEL77Kz6CYCIl1vouVPDoRQXxXLbJJF1Nd9fdSa2Kv73OJq1Q9OQlS@Z77k4oVKPWeuGsZ4T4kzfK1K2qKXc2cKVX9y7g6AjGMjy9ttpTicp6VK0pWFujGs3vA1jTvHfzUgc1a7SpoVCR4tYT3pQ3Mtmzs2cqGHftYkb@QflAHrRiMmXAjXP43AOWqoneYzyyjy6Ta9waxmQ9zYOTrDRBkuUL5dLEW563y0DaJNqUtLqvMM0P05MsPc@E8tI75GzFYA2UVEV3XSqm1HQdwjZmID2cdKNyHOOyMZ6MltSuUl9KFdzKMYnttvKsQ1WQi3C6JUx@vHrYSQA3Jg3Jwf5Gd4BaLylgf6NJC@u9SLIkSr76Z@iLJtYQ@M2C554oGeB4dJLtED7IW/yDJetqZY9SBEGvEGhJBqTrOUO2tTE5PTu/uLzatYooOj/xEtrVcLRLiBEd/vMR1mg4HP6uJMAf0x2h4F/rbw "Scala – Try It Online")
This is the "rothuvsein" approach in Scala. The 7th character of each (repeated) number string is extracted via `(numberString*3)(6)`. The position of this character in "rothuvsein" is then used as the correct numerical digit. The `toInt` conversion does the rest (e.g., dealing with leading zeros).
2 times 2 bytes saved thanks to @user by
1. an even more abused use of syntactic sugar :)
2. simply using `toInt` conversion rather than `BigInt` constructor
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 26 bytes
```
10⊥'rothuvsein'⍳7⊢/⍤⍴¨≠⍛⊆⍨
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/qG@qp/@jtgkG/w0NHnUtVS/KL8koLStOzcxTf9S72fxR1yL9R71LHvVuObTiUeeCR72zH3W1Pepd8T8NqOdRb9@jruZHvWtA0uuNH7VNBJoWHOQMJEM8PIP/pymo5@elKpSU5yuUZBSlpkJIdS6geFVqUb4CmICqUAcA "APL (Dyalog Extended) – Try It Online")
A simple function which checks the first two letters of each word.
-30 bytes from Adám using Kevin Cruijssen's idea.
## Explanation(old)
```
     {⍕2÷⍨1-⍨(2↑⍵)(⍸⍷)'zeontwthfofisiseeinite'} inner fn: 
             (2↑⍵)                              take first two letters
                  (⍸⍷)'zeontwthfofisiseeinite'} find index of the letters in hardcoded string
       2÷⍨1-⍨                                   subtract 1, divide by 2
      ⍕                                         stringify
{⍎⊃,/{⍕2÷⍨1-⍨(2↑⍵)(⍸⍷)'zeontwthfofisiseeinite'}¨' '(≠⊆⊢)⍵} ⍵ → input
                                                ' '(≠⊆⊢)⍵  split input on spaces
   ,/                                                      join output of inner fn
 ⍎⊃                                                        execute it
```
[Answer]
# [Python 3](https://docs.python.org/3/), 85 bytes
I put two versions of my explanation just for fun :)
Split the input **`i`** into words and loop over it using list comprehension.
For all the words find the location of the first 2 letters in a lookup table (*"zeontwthfofisiseeini"*), making sure to divide by two - with **`//`** for floor division, finally use **`"".join(`** to combine into a string and **`int(`** to convert to integer and remove leading zero(s).
```
lambda i:int("".join([str("zeontwthfofisiseeini".find(x[:2])//2)for x in i.split()]))
```
[Try it online!](https://tio.run/##JczBDoIwEIThV9n01F4g0RuJT4IcELYyBndJuwL68gh6meRPJt/0tkHlvHWX6za2z1vfEiqIeeeKh0J8nS1592EVW2yIGpGRmSFwRYT0fq2rUxPK8hSiJloJQijyNMJ8aELYpnRw3WEkpd9EzEyM@2AkECZblDLPLKR7ZawU9ZX@XxsSs9udLw "Python 3 – Try It Online")
* `lambda i:` lambda function instead of using a `def` function
* `[for x in]` use list comprehension to check through the input
* `i.split` split the input at spaces (default delimiter)
* `"zeontwthfofisiseeini".find(x[:2])` find the location of the first two characters of **x** in a lookup list
* `//2` floor divide output of `.find` because it's checking the first 2 chars
* `str()` convert position to string
* `"".join()` combine output of list comprehension to a string
* `int()` convert string to int and remove leading zero(s)
Also, this is accidentally similar to [this](https://codegolf.stackexchange.com/a/193359/100140) answer but I made mine before looking at the other answers.
]