UNPKG
compromise
Version:
latest (14.21.0)
next (14.2.0-rc2)
14.21.0
14.20.0
14.19.0
14.18.0
14.17.0
14.16.0
14.15.1
14.15.0
14.14.5
14.14.4
14.14.3
14.14.2
14.14.1
14.14.0
14.13.0
14.12.0
14.11.2
14.11.1
14.11.0
14.10.1
14.10.0
14.9.0
14.8.2
14.8.1
14.8.0
14.7.1
14.7.0
14.6.0
14.5.2
14.5.1
14.5.0
14.4.5
14.4.4
14.4.3
14.4.2
14.4.1
14.4.0
14.3.1
14.3.0
14.2.1
14.2.0
14.2.0-rc2
14.2.0-rc1
14.1.2
14.1.1
14.1.0
14.0.0
13.11.4
13.11.4-rc8
13.11.4-rc7
13.11.4-rc6
13.11.4-rc5
13.11.4-rc4
13.11.4-rc3
13.11.4-rc2
13.11.4-next
13.11.3
13.11.2
13.11.1
13.11.0
13.10.6
13.10.5
13.10.4
13.10.3
13.10.2
13.10.1
13.10.0
13.9.3
13.9.2
13.9.1
13.9.0
13.8.0
13.7.0
13.6.0
13.5.0
13.4.0
13.3.2
13.3.1
13.3.0
13.2.0
13.1.1
13.1.0
13.0.0
13.0.0-rc1
12.3.0
12.2.1
12.2.0
12.1.0
12.0.0
12.0.0-rc2
12.0.0-rc1
11.14.3
11.14.2
11.13.2
11.13.1
11.13.0
11.12.6
11.12.5
11.12.4
11.12.3
11.12.2
11.12.1
11.12.0
11.11.0
11.10.1
11.10.0
11.9.1
11.9.0
11.8.0
11.7.0
11.6.0
11.5.3
11.5.2
11.5.1
11.5.0
11.4.0
11.3.0
11.2.3
11.2.2
11.2.1
11.1.0
11.0.2
11.0.1
11.0.0
10.7.2
10.7.1
10.7.0
10.6.1
10.6.0
10.5.2
10.5.1
10.5.0
10.4.2
10.4.1
10.4.0
10.3.0
10.2.2
10.2.1
10.2.0
10.1.0
10.0.1
10.0.0
9.1.0
9.0.0
8.2.0
8.1.0
8.0.2
8.0.1
8.0.0
7.0.28
7.0.27
7.0.26
7.0.25
7.0.24
7.0.23
7.0.22
7.0.21
7.0.20
7.0.19
7.0.18
7.0.17
7.0.16
7.0.15
7.0.14
7.0.13
7.0.12
7.0.11
7.0.10
7.0.9
7.0.8
7.0.7
7.0.6
7.0.5
7.0.4
7.0.3
7.0.2
7.0.1
7.0.0
0.1.1
0.1.0
modest natural language processing
compromise.cool
compromise
/
src
/
2-two
/
preTagger
/
model
/
_lib.js
11 lines
(9 loc)
•
243 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
// Expand adjacent same-tag keys once, preserving insertion and override order.
const
tagWords
= (
words, tag
) => {
const
result = {} words.
split
(
' '
).
forEach
(
word
=>
{ result[word] = tag })
return
result }
export
default
tagWords