-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
45 lines (41 loc) · 1.55 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {
Token,
TokenDate,
TokenDirectionMonth,
TokenDirectionWeek,
TokenDirectionYear,
TokenEnumeration,
TokenRange,
TokenTypes
} from '../../token';
import { ILocale, ITokenDetector } from '../locale';
import DateDetector from '../detectors/dateDetector';
import EnglishAnchorStartDetector from './detectors/anchorStartDetector';
import EnglishDayOfMonthDetector from './detectors/dayOfMonthDetector';
import EnglishDayOfWeekDetector from './detectors/dayOfWeekDetector';
import EnglishDirectionAndDurationDetector from './detectors/directionAndDurationDetector';
import EnglishDirectionDetector from './detectors/directionDetector';
import EnglishDurationDetector from './detectors/durationDetector';
import EnglishEnumerationDetector from './detectors/enumerationDetector';
import EnglishMonthDetector from './detectors/monthDetector';
import EnglishNamedDayDetector from './detectors/namedDayDetector';
import EnglishRangeDetector from './detectors/rangeDetector';
export class EnglishLocale implements ILocale {
public readonly splitBy = /[^A-Za-zА-Яа-я0-9/_-]+/;
public readonly maxNGram = 4;
public detectors() {
return [
new DateDetector(),
new EnglishAnchorStartDetector(),
new EnglishDayOfMonthDetector(),
new EnglishDayOfWeekDetector(),
new EnglishDirectionAndDurationDetector(),
new EnglishDirectionDetector(),
new EnglishDurationDetector(),
new EnglishEnumerationDetector(),
new EnglishMonthDetector(),
new EnglishNamedDayDetector(),
new EnglishRangeDetector()
];
}
}