Skip to content

Commit

Permalink
added more alphanumeric translations
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGuest committed Aug 6, 2021
1 parent 7256bd7 commit 0e9cda2
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 4 deletions.
52 changes: 50 additions & 2 deletions models/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,59 +139,107 @@ class Search {
getPosition(query) {
let grid = [
'winner',
'1st',
'won',
'first',
'second',
'2nd',
'third',
'3rd',
'fourth',
'4th',
'fifth',
'5th',
'sixth',
'6th',
'seventh',
'7th',
'eighth',
'8th',
'ninth',
'9th',
'10th',
'tenth',
'11th',
'eleventh',
'12th',
'twelfth',
'13th',
'thirteenth',
'14th',
'fourteenth',
'15th',
'fifteenth',
'16th',
'sixteenth',
'17th',
'seventeenth',
'18th',
'eighteenth',
'19th',
'nineteenth',
'20th',
'twentieth',
'21st',
'twentyfirst',
'22nd',
'twentysecond',
'23rd',
'24th'
'twentythird',
'24th',
'twentyfourth'
];
const gridTranslator = {
won: 1,
winner: 1,
first: 1,
'1st': 1,
second: 2,
'2nd': 2,
third: 3,
'3rd': 3,
fourth: 4,
'4th': 4,
fifth: 5,
'5th': 5,
sixth: 6,
'6th': 6,
seventh: 7,
'7th': 7,
eighth: 8,
'8th': 8,
ninth: 9,
'9th': 9,
'10th': 10,
tenth: 10,
'11th': 11,
eleventh: 11,
'12th': 12,
twelfth: 12,
'13th': 13,
thirteenth: 13,
'14th': 14,
fourteenth: 14,
'15th': 15,
fifteenth: 15,
'16th': 16,
sixteenth: 16,
'17th': 17,
seventeenth: 17,
'18th': 18,
eighteenth: 18,
'19th': 19,
nineteenth: 19,
'20th': 20,
twentyth: 20,
'21st': 21,
twentyfirst: 21,
'22nd': 22,
twentysecond: 22,
'23rd': 23,
'24th': 24
twentythird: 23,
'24th': 24,
twentyfourth: 24
};
const queryArray = query.split(' ');
let position = '';
Expand Down
52 changes: 50 additions & 2 deletions models/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,59 +155,107 @@ class Search {
getPosition(query) {
let grid = [
'winner',
'1st',
'won',
'first',
'second',
'2nd',
'third',
'3rd',
'fourth',
'4th',
'fifth',
'5th',
'sixth',
'6th',
'seventh',
'7th',
'eighth',
'8th',
'ninth',
'9th',
'10th',
'tenth',
'11th',
'eleventh',
'12th',
'twelfth',
'13th',
'thirteenth',
'14th',
'fourteenth',
'15th',
'fifteenth',
'16th',
'sixteenth',
'17th',
'seventeenth',
'18th',
'eighteenth',
'19th',
'nineteenth',
'20th',
'twentieth',
'21st',
'twentyfirst',
'22nd',
'twentysecond',
'23rd',
'24th'
'twentythird',
'24th',
'twentyfourth'
];
const gridTranslator = {
won: 1,
winner: 1,
first: 1,
'1st': 1,
second: 2,
'2nd': 2,
third: 3,
'3rd': 3,
fourth: 4,
'4th': 4,
fifth: 5,
'5th': 5,
sixth: 6,
'6th': 6,
seventh: 7,
'7th': 7,
eighth: 8,
'8th': 8,
ninth: 9,
'9th': 9,
'10th': 10,
tenth: 10,
'11th': 11,
eleventh: 11,
'12th': 12,
twelfth: 12,
'13th': 13,
thirteenth: 13,
'14th': 14,
fourteenth: 14,
'15th': 15,
fifteenth: 15,
'16th': 16,
sixteenth: 16,
'17th': 17,
seventeenth: 17,
'18th': 18,
eighteenth: 18,
'19th': 19,
nineteenth: 19,
'20th': 20,
twentyth: 20,
'21st': 21,
twentyfirst: 21,
'22nd': 22,
twentysecond: 22,
'23rd': 23,
'24th': 24
twentythird: 23,
'24th': 24,
twentyfourth: 24
};
const queryArray = query.split(' ');
let position = '';
Expand Down

0 comments on commit 0e9cda2

Please sign in to comment.