mirror of
https://github.com/anatolykopyl/mining-status-skill.git
synced 2026-03-26 12:55:43 +00:00
Initial commit
This commit is contained in:
31
phonetics.js
Normal file
31
phonetics.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const phoneticTable = {
|
||||
'анна': 'a',
|
||||
'антон': 'a',
|
||||
'алексей': 'a',
|
||||
'борис': 'b',
|
||||
'семен': 'c',
|
||||
'цапля': 'c',
|
||||
'дмитрий': 'd',
|
||||
'елена': 'e',
|
||||
'федор': 'f',
|
||||
'фёдор': 'f',
|
||||
'харитон': 'x',
|
||||
}
|
||||
|
||||
// 0xfB2A2c470d75f6Fc1cb85A592840D960C000e94c
|
||||
|
||||
module.exports = (tokens) => {
|
||||
return tokens.map((token) => {
|
||||
if (!isNaN(token)) {
|
||||
return parseInt(token);
|
||||
} else {
|
||||
const lowerToken = token.toLowerCase();
|
||||
|
||||
if (phoneticTable.hasOwnProperty(lowerToken)) {
|
||||
return phoneticTable[lowerToken];
|
||||
} else {
|
||||
return ' не расслышала ';
|
||||
}
|
||||
}
|
||||
}).join()
|
||||
}
|
||||
Reference in New Issue
Block a user