@chaffjs/lang-en 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emphasis.d.ts +14 -1
- package/dist/emphasis.d.ts.map +1 -1
- package/dist/emphasis.js +41 -1
- package/dist/emphasis.js.map +1 -1
- package/dist/pos.d.ts.map +1 -1
- package/dist/pos.js +13 -4
- package/dist/pos.js.map +1 -1
- package/lexicons/address-label.yaml +15 -0
- package/lexicons/battery-label.yaml +50 -0
- package/lexicons/battery-unit.yaml +18 -0
- package/lexicons/capacity-exception.yaml +28 -0
- package/lexicons/capacity-label.yaml +10 -0
- package/lexicons/clock-range-joiner.yaml +12 -0
- package/lexicons/contact-label.yaml +11 -0
- package/lexicons/count-frame.yaml +9 -0
- package/lexicons/count-hedge.yaml +11 -1
- package/lexicons/date-change-word.yaml +5 -0
- package/lexicons/date-now-word.yaml +7 -0
- package/lexicons/dated-pair-label.yaml +14 -0
- package/lexicons/event-aside.yaml +15 -0
- package/lexicons/event-date-label.yaml +12 -0
- package/lexicons/event-deadline-word.yaml +11 -0
- package/lexicons/event-registration-word.yaml +18 -0
- package/lexicons/headcount-label.yaml +21 -0
- package/lexicons/headcount-unit.yaml +22 -0
- package/lexicons/item-amount.yaml +34 -0
- package/lexicons/item-at-hand.yaml +15 -0
- package/lexicons/item-list-heading.yaml +21 -0
- package/lexicons/item-use.yaml +74 -0
- package/lexicons/layout-code.yaml +13 -0
- package/lexicons/layout-label.yaml +14 -0
- package/lexicons/layout-room.yaml +16 -0
- package/lexicons/measure-per-mark.yaml +8 -0
- package/lexicons/measure-value-lead.yaml +8 -0
- package/lexicons/model-code-label.yaml +17 -0
- package/lexicons/name-joiner.yaml +9 -0
- package/lexicons/name-label.yaml +10 -0
- package/lexicons/name-quote.yaml +7 -0
- package/lexicons/name-stem-suffix.yaml +12 -0
- package/lexicons/name-title-joiner.yaml +9 -0
- package/lexicons/period-after-term.yaml +25 -0
- package/lexicons/period-deadline.yaml +27 -0
- package/lexicons/period-overview-heading.yaml +10 -0
- package/lexicons/period-term-label.yaml +12 -0
- package/lexicons/phone-label.yaml +1 -0
- package/lexicons/place-word.yaml +7 -1
- package/lexicons/proper-name-word.yaml +55 -0
- package/lexicons/quantity-bound-label.yaml +13 -0
- package/lexicons/quantity-change-word.yaml +47 -0
- package/lexicons/quantity-range-word.yaml +6 -0
- package/lexicons/range-band-heading.yaml +16 -0
- package/lexicons/range-band-unit.yaml +34 -0
- package/lexicons/range-band-word.yaml +49 -0
- package/lexicons/rent-label.yaml +14 -0
- package/lexicons/rent-multiple-label.yaml +11 -0
- package/lexicons/rent-multiple-word.yaml +44 -0
- package/lexicons/requirement-heading.yaml +22 -0
- package/lexicons/requirement-item-ending.yaml +6 -0
- package/lexicons/requirement-length-unit.yaml +10 -0
- package/lexicons/requirement-length-word.yaml +14 -0
- package/lexicons/retention-bound.yaml +25 -0
- package/lexicons/retention-length-mark.yaml +7 -0
- package/lexicons/retention-length-modifier.yaml +6 -0
- package/lexicons/retention-object-mark.yaml +5 -0
- package/lexicons/retention-unit.yaml +5 -0
- package/lexicons/retention-verb.yaml +12 -0
- package/lexicons/return-clause.yaml +16 -0
- package/lexicons/return-item.yaml +7 -0
- package/lexicons/return-label.yaml +10 -0
- package/lexicons/return-type-word.yaml +16 -0
- package/lexicons/return-verb.yaml +6 -0
- package/lexicons/scaled-unit-form.yaml +59 -0
- package/lexicons/servings-column.yaml +26 -0
- package/lexicons/session-count-unit.yaml +10 -0
- package/lexicons/session-total.yaml +11 -0
- package/lexicons/stamp-order-label.yaml +25 -0
- package/lexicons/step-time-not-own.yaml +36 -0
- package/lexicons/step-time-total.yaml +9 -0
- package/lexicons/total-label-qualifier.yaml +33 -0
- package/lexicons/travel-time-word.yaml +38 -0
- package/lexicons/unit-area.yaml +48 -0
- package/lexicons/unit-context.yaml +36 -0
- package/lexicons/unit-equivalent-hedge.yaml +11 -0
- package/lexicons/unit-item-link.yaml +5 -0
- package/lexicons/unit-length.yaml +3 -0
- package/lexicons/unit-pressure.yaml +12 -0
- package/lexicons/unit-temperature.yaml +20 -0
- package/lexicons/unit-volume.yaml +33 -0
- package/lexicons/unit-zero.yaml +12 -0
- package/lexicons/unscaled-amount.yaml +12 -0
- package/lexicons/use-count-word.yaml +49 -0
- package/lexicons/use-interval-word.yaml +21 -0
- package/lexicons/walk-rate.yaml +23 -0
- package/lexicons/walk-word.yaml +20 -0
- package/lexicons/working-hours-break.yaml +10 -0
- package/lexicons/working-hours-total.yaml +11 -0
- package/package.json +1 -1
- package/src/emphasis.ts +53 -2
- package/src/pos.ts +11 -5
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Counts of uses in a period ("3 times a day") and the words that make a number a limit (product-exceeds-maximum,
|
|
2
|
+
# interval-count-mismatch). Group period is a period, weight its length in hours, written after the count. counter is
|
|
3
|
+
# what a count of uses is written in. alone is a number word that counts without a counter ("twice a day"), weight its
|
|
4
|
+
# value. limit makes a number a maximum: before, anywhere earlier in the same sentence ("the maximum daily dose is 4
|
|
5
|
+
# tablets"); after, right behind it ("4 tablets or less"). limit-negated is a limit only with a negation earlier in the
|
|
6
|
+
# sentence ("do not take more than"; "you may need more than" is not one).
|
|
7
|
+
id: use-count-word
|
|
8
|
+
language: en
|
|
9
|
+
entries:
|
|
10
|
+
- { pattern: "a day", group: period, weight: 24, position: after }
|
|
11
|
+
- { pattern: "per day", group: period, weight: 24, position: after }
|
|
12
|
+
- { pattern: "each day", group: period, weight: 24, position: after }
|
|
13
|
+
- { pattern: "every day", group: period, weight: 24, position: after }
|
|
14
|
+
- { pattern: "daily", group: period, weight: 24, position: after }
|
|
15
|
+
- { pattern: "in 24 hours", group: period, weight: 24, position: after }
|
|
16
|
+
- { pattern: "in any 24 hours", group: period, weight: 24, position: after }
|
|
17
|
+
- { pattern: "per 24 hours", group: period, weight: 24, position: after }
|
|
18
|
+
- { pattern: "in a 24-hour period", group: period, weight: 24, position: after }
|
|
19
|
+
- { pattern: "in any 24-hour period", group: period, weight: 24, position: after }
|
|
20
|
+
- { pattern: "a week", group: period, weight: 168, position: after }
|
|
21
|
+
- { pattern: "per week", group: period, weight: 168, position: after }
|
|
22
|
+
- { pattern: "weekly", group: period, weight: 168, position: after }
|
|
23
|
+
- { pattern: "times", group: counter }
|
|
24
|
+
- { pattern: "doses", group: counter }
|
|
25
|
+
- { pattern: "uses", group: counter }
|
|
26
|
+
- { pattern: "servings", group: counter }
|
|
27
|
+
- { pattern: "feedings", group: counter }
|
|
28
|
+
- { pattern: "applications", group: counter }
|
|
29
|
+
- { pattern: "once", group: alone, weight: 1 }
|
|
30
|
+
- { pattern: "twice", group: alone, weight: 2 }
|
|
31
|
+
- { pattern: "thrice", group: alone, weight: 3 }
|
|
32
|
+
- { pattern: "maximum", group: limit, position: before }
|
|
33
|
+
- { pattern: "max", group: limit, position: before }
|
|
34
|
+
- { pattern: "no more than", group: limit, position: before }
|
|
35
|
+
- { pattern: "not more than", group: limit, position: before }
|
|
36
|
+
- { pattern: "more than", group: limit-negated, position: before }
|
|
37
|
+
- { pattern: "up to", group: limit, position: before }
|
|
38
|
+
- { pattern: "at most", group: limit, position: before }
|
|
39
|
+
- { pattern: "exceed", group: limit, position: before }
|
|
40
|
+
- { pattern: "limit", group: limit, position: before }
|
|
41
|
+
- { pattern: "or less", group: limit, position: after }
|
|
42
|
+
- { pattern: "or fewer", group: limit, position: after }
|
|
43
|
+
- { pattern: "at most", group: limit, position: after }
|
|
44
|
+
- { pattern: "not", group: negation }
|
|
45
|
+
- { pattern: "never", group: negation }
|
|
46
|
+
- { pattern: "don't", group: negation }
|
|
47
|
+
- { pattern: "do not", group: negation }
|
|
48
|
+
- { pattern: "must not", group: negation }
|
|
49
|
+
- { pattern: "should not", group: negation }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# The minimum interval between uses and the count column of a table (interval-count-mismatch). minimum makes a length
|
|
2
|
+
# a lower bound, written right before it ("at least 4 hours"). cue makes that length an interval between uses, in the
|
|
3
|
+
# same sentence ("between", "apart"). column is the heading of a table column of uses in a period, weight the period's
|
|
4
|
+
# length in hours.
|
|
5
|
+
id: use-interval-word
|
|
6
|
+
language: en
|
|
7
|
+
entries:
|
|
8
|
+
- { pattern: "at least", group: minimum, position: before }
|
|
9
|
+
- { pattern: "no less than", group: minimum, position: before }
|
|
10
|
+
- { pattern: "not less than", group: minimum, position: before }
|
|
11
|
+
- { pattern: "a minimum of", group: minimum, position: before }
|
|
12
|
+
- { pattern: "between", group: cue }
|
|
13
|
+
- { pattern: "apart", group: cue }
|
|
14
|
+
- { pattern: "interval", group: cue }
|
|
15
|
+
- { pattern: "gap", group: cue }
|
|
16
|
+
- { pattern: "Times a day", group: column, weight: 24 }
|
|
17
|
+
- { pattern: "Times per day", group: column, weight: 24 }
|
|
18
|
+
- { pattern: "Doses a day", group: column, weight: 24 }
|
|
19
|
+
- { pattern: "Doses per day", group: column, weight: 24 }
|
|
20
|
+
- { pattern: "Uses a day", group: column, weight: 24 }
|
|
21
|
+
- { pattern: "Uses per day", group: column, weight: 24 }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Walking speed (walk-time-distance-mismatch). English has no default speed: minutes are compared with a distance only when
|
|
2
|
+
# the document states its own rate. group per: the words that make a length a speed ("80 m per minute", "5 km/h"); position is
|
|
3
|
+
# the side of the length, weight the seconds of that time. group round-up: words on the rate's line saying part minutes are
|
|
4
|
+
# rounded up; without one, rounding either way is accepted. group not-round-up: words that say it is not rounded up
|
|
5
|
+
# ("not rounded up", "to the nearest minute"), which win over a round-up word.
|
|
6
|
+
id: walk-rate
|
|
7
|
+
language: en
|
|
8
|
+
entries:
|
|
9
|
+
- { pattern: "per minute", position: after, group: per, weight: 60 }
|
|
10
|
+
- { pattern: "a minute", position: after, group: per, weight: 60 }
|
|
11
|
+
- { pattern: "/min", position: after, group: per, weight: 60 }
|
|
12
|
+
- { pattern: "/minute", position: after, group: per, weight: 60 }
|
|
13
|
+
- { pattern: "per hour", position: after, group: per, weight: 3600 }
|
|
14
|
+
- { pattern: "an hour", position: after, group: per, weight: 3600 }
|
|
15
|
+
- { pattern: "/h", position: after, group: per, weight: 3600 }
|
|
16
|
+
- { pattern: "/hr", position: after, group: per, weight: 3600 }
|
|
17
|
+
- { pattern: "rounded up", group: round-up }
|
|
18
|
+
- { pattern: "round up", group: round-up }
|
|
19
|
+
- { pattern: "rounding up", group: round-up }
|
|
20
|
+
- { pattern: "not rounded up", group: not-round-up }
|
|
21
|
+
- { pattern: "not round up", group: not-round-up }
|
|
22
|
+
- { pattern: "rounded down", group: not-round-up }
|
|
23
|
+
- { pattern: "to the nearest", group: not-round-up }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Words that make a number of minutes a walking time (walk-time-distance-mismatch). group walk: the word after the minutes
|
|
2
|
+
# ("a 5-minute walk", "5 minutes on foot"). group bound: a word that makes the minutes a limit ("within a 10-minute walk"),
|
|
3
|
+
# never compared; position is the side of the minutes. group range: a word joining two numbers into a range ("8 to 10
|
|
4
|
+
# minutes"), never compared. group filler: a word skipped between "about" or "within" and the number.
|
|
5
|
+
id: walk-word
|
|
6
|
+
language: en
|
|
7
|
+
entries:
|
|
8
|
+
- { pattern: "walk", position: after, group: walk }
|
|
9
|
+
- { pattern: "walking", position: after, group: walk }
|
|
10
|
+
- { pattern: "on foot", position: after, group: walk }
|
|
11
|
+
- { pattern: "by foot", position: after, group: walk }
|
|
12
|
+
- { pattern: "within", position: before, group: bound }
|
|
13
|
+
- { pattern: "under", position: before, group: bound }
|
|
14
|
+
- { pattern: "less than", position: before, group: bound }
|
|
15
|
+
- { pattern: "up to", position: before, group: bound }
|
|
16
|
+
- { pattern: "or less", position: after, group: bound }
|
|
17
|
+
- { pattern: "to", group: range }
|
|
18
|
+
- { pattern: "or", group: range }
|
|
19
|
+
- { pattern: "a", group: filler }
|
|
20
|
+
- { pattern: "an", group: filler }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Words beside the length of a break (duration-mismatch, working hours). before: written before the length ("break of 1 hour"); after: behind it ("a 1-hour break").
|
|
2
|
+
id: working-hours-break
|
|
3
|
+
language: en
|
|
4
|
+
entries:
|
|
5
|
+
- { pattern: "break", position: before }
|
|
6
|
+
- { pattern: "break of", position: before }
|
|
7
|
+
- { pattern: "lunch break", position: before }
|
|
8
|
+
- { pattern: "lunch break of", position: before }
|
|
9
|
+
- { pattern: "break", position: after }
|
|
10
|
+
- { pattern: "lunch break", position: after }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Words beside the hours worked once the break is taken out (duration-mismatch, working hours). before: written before the length; after: behind it ("8 hours of work", "8 hours a day").
|
|
2
|
+
id: working-hours-total
|
|
3
|
+
language: en
|
|
4
|
+
entries:
|
|
5
|
+
- { pattern: "net", position: before }
|
|
6
|
+
- { pattern: "of work", position: after }
|
|
7
|
+
- { pattern: "of working time", position: after }
|
|
8
|
+
- { pattern: "work", position: after }
|
|
9
|
+
- { pattern: "a day", position: after }
|
|
10
|
+
- { pattern: "per day", position: after }
|
|
11
|
+
- { pattern: "net", position: after }
|
package/package.json
CHANGED
package/src/emphasis.ts
CHANGED
|
@@ -1,16 +1,67 @@
|
|
|
1
|
-
// A word written in capitals for emphasis (the office will NEVER call you), told from an acronym by the dictionary
|
|
1
|
+
// A word written in capitals for emphasis (the office will NEVER call you), told from an acronym by the dictionary and by how
|
|
2
|
+
// the tagger read it in its sentence.
|
|
2
3
|
|
|
3
4
|
const CAPITALS = /^\p{Lu}{2,}$/u;
|
|
5
|
+
const LOWERCASE = /\p{Ll}/u;
|
|
4
6
|
|
|
5
7
|
const ADVERB_TAGS: ReadonlySet<string> = new Set(["RB", "RBR", "RBS"]);
|
|
6
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Penn tags of closed word classes: preposition, conjunction, determiner, numeral, pronoun, particle, modal. An acronym names a
|
|
11
|
+
* thing, so it stands where a noun stands, never where one of these does.
|
|
12
|
+
*/
|
|
13
|
+
const CLOSED_CLASS_TAGS: ReadonlySet<string> = new Set(["IN", "CC", "DT", "PDT", "CD", "PRP", "PRP$", "TO", "RP", "MD", "WDT", "WP", "EX"]);
|
|
14
|
+
|
|
15
|
+
/** A determiner or possessive opens a noun phrase: what follows it (the IT team, the US office) is a name, though a numeral may come between (the ONE storm). */
|
|
16
|
+
const NOUN_PHRASE_OPENERS: ReadonlySet<string> = new Set(["DT", "PDT", "PRP$", "POS"]);
|
|
17
|
+
|
|
18
|
+
/** What can stand right before a finite verb in a sentence: a common noun or pronoun subject, or a modal (a hurricane DID form). */
|
|
19
|
+
const SUBJECT_TAGS: ReadonlySet<string> = new Set(["NN", "NNS", "PRP", "MD"]);
|
|
20
|
+
|
|
21
|
+
type TaggedWord = { readonly value: string; readonly pos: string };
|
|
22
|
+
|
|
23
|
+
type TagsOf = (word: string) => readonly string[] | undefined;
|
|
24
|
+
|
|
7
25
|
/**
|
|
8
26
|
* The dictionary knows the lower-case word, and only as an adverb (never, always, also). An acronym names a thing, so a word
|
|
9
27
|
* with no noun or adjective reading cannot be one. A word that is also a noun or an adjective (fast, eagle, cheese) is kept:
|
|
10
28
|
* FAST and EAGLE are a telescope and a simulation, and the context tagger cannot tell them from emphasis.
|
|
11
29
|
*/
|
|
12
|
-
export const isEmphasisedAdverb = (surface: string, tagsOf:
|
|
30
|
+
export const isEmphasisedAdverb = (surface: string, tagsOf: TagsOf): boolean => {
|
|
13
31
|
if (!CAPITALS.test(surface)) return false;
|
|
14
32
|
const tags = tagsOf(surface.toLowerCase()) ?? [];
|
|
15
33
|
return tags.length > 0 && tags.every((tag) => ADVERB_TAGS.has(tag));
|
|
16
34
|
};
|
|
35
|
+
|
|
36
|
+
/** After a verb, a word the tagger read as a noun must also be a verb in the dictionary (DID form), or it is what the capitals name (DID token). */
|
|
37
|
+
const canFollowVerb = (next: TaggedWord, tagsOf: TagsOf): boolean => !next.pos.startsWith("NN") || (tagsOf(next.value.toLowerCase()) ?? []).includes("VB");
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The tagger read the capitals word, in its sentence, as one of the dictionary's readings of the lower-case word, and that
|
|
41
|
+
* reading is a closed class (AFTER the departure, NOR a remote position), or a verb right after its subject (a hurricane DID
|
|
42
|
+
* form). The word sits inside lower-case prose, with a lower-case word on each side: at the start of a sentence (ON
|
|
43
|
+
* Semiconductor), at its end (via IT.) or on a line alone (AT.) there is nothing to read it in. A verb after anything but its
|
|
44
|
+
* subject, or before a noun, stays a name: on the GOES satellites, the states are: LISTEN, the user DID token. Adjectives
|
|
45
|
+
* stay too: the WHOLE month reads like the SAFE framework, and only meaning tells them apart.
|
|
46
|
+
*/
|
|
47
|
+
const isReadAsWord = (tagged: readonly TaggedWord[], at: number, tagsOf: TagsOf): boolean => {
|
|
48
|
+
const word = tagged[at];
|
|
49
|
+
const [previous, next] = [tagged[at - 1], tagged[at + 1]];
|
|
50
|
+
if (word === undefined || previous === undefined || next === undefined) return false;
|
|
51
|
+
if (!(tagsOf(word.value.toLowerCase()) ?? []).includes(word.pos) || !LOWERCASE.test(previous.value) || !LOWERCASE.test(next.value)) return false;
|
|
52
|
+
if (CLOSED_CLASS_TAGS.has(word.pos)) return word.pos === "CD" || !NOUN_PHRASE_OPENERS.has(previous.pos);
|
|
53
|
+
return word.pos.startsWith("VB") && SUBJECT_TAGS.has(previous.pos) && canFollowVerb(next, tagsOf);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** A word joined to its neighbour with no space (US-CERT, SOME/2, IT's) is part of a compound, a label or a name, not a word on its own. */
|
|
57
|
+
const JOINED = /[\p{L}\p{N}_&/'’-]/u;
|
|
58
|
+
|
|
59
|
+
type WordSpan = { readonly start: number; readonly end: number };
|
|
60
|
+
|
|
61
|
+
export const standsAlone = (text: string, span: WordSpan): boolean => !JOINED.test(text.charAt(span.start - 1)) && !JOINED.test(text.charAt(span.end));
|
|
62
|
+
|
|
63
|
+
/** A capitals word the sentence reads as an English word (not the adverb-only case above), so emphasis and not an acronym. */
|
|
64
|
+
export const isEmphasisedWord = (tagged: readonly TaggedWord[], at: number, tagsOf: TagsOf): boolean => {
|
|
65
|
+
const surface = tagged[at]?.value ?? "";
|
|
66
|
+
return CAPITALS.test(surface) && isReadAsWord(tagged, at, tagsOf);
|
|
67
|
+
};
|
package/src/pos.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { loadLexicons } from "./lexicons.ts";
|
|
|
4
4
|
import { blankLongRuns } from "./long-runs.ts";
|
|
5
5
|
import { lowercasedAt, properNounChecked, rereadAt, sentenceInitialCommonWord } from "./proper-noun.ts";
|
|
6
6
|
import { isStativeParticiple, stativeVocabulary } from "./stative-participle.ts";
|
|
7
|
-
import { isEmphasisedAdverb } from "./emphasis.ts";
|
|
7
|
+
import { isEmphasisedAdverb, isEmphasisedWord, standsAlone } from "./emphasis.ts";
|
|
8
8
|
import { gerundFeatures } from "./gerund.ts";
|
|
9
9
|
import { winkLexiconWords, winkPosTagger } from "./wink-modules.ts";
|
|
10
10
|
|
|
@@ -234,9 +234,15 @@ export const prepare = (): void => {
|
|
|
234
234
|
|
|
235
235
|
export const isReady = (): boolean => state.ready !== undefined;
|
|
236
236
|
|
|
237
|
-
/**
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
/**
|
|
238
|
+
* 大文字で強調した副詞(NEVER)は、解析器が名前と付けても副詞。文の中で前置詞や動詞として読めた語(AFTER the departure、
|
|
239
|
+
* a hurricane DID form)は、解析器の読みのまま。どちらも Emph=Yes で、略語ではないと detector に伝える。
|
|
240
|
+
*/
|
|
241
|
+
const withEmphasis = (token: Token, text: string, tagged: readonly Tagged[], at: number): Token => {
|
|
242
|
+
if (isEmphasisedAdverb(token.surface, state.vocabulary)) return { ...token, pos: "ADV", lemma: token.surface.toLowerCase(), features: { Emph: "Yes" } };
|
|
243
|
+
if (!standsAlone(text, token.span) || !isEmphasisedWord(tagged, at, state.vocabulary)) return token;
|
|
244
|
+
return { ...token, lemma: (token.lemma ?? token.surface).toLowerCase(), features: { ...token.features, Emph: "Yes" } };
|
|
245
|
+
};
|
|
240
246
|
|
|
241
247
|
/**
|
|
242
248
|
* wink は位置を返さないので、表層を順に照合して復元する。
|
|
@@ -257,7 +263,7 @@ const locate = (text: string, tagged: readonly Tagged[]): Token[] => {
|
|
|
257
263
|
...(entry.lemma === undefined ? {} : { lemma: entry.lemma }),
|
|
258
264
|
...featuresOf(tagged, at),
|
|
259
265
|
};
|
|
260
|
-
tokens.push(withEmphasis(token));
|
|
266
|
+
tokens.push(withEmphasis(token, text, tagged, at));
|
|
261
267
|
cursor = end;
|
|
262
268
|
});
|
|
263
269
|
return tokens;
|