-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
113 lines (112 loc) · 2.69 KB
/
index.test.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
const parse = require('./index')
const testData = [{
input: "This new virus inhibits the thyrotropes",
expected: [{
"ngram": "thyrotropes",
"value": {
"id": "thyrotropic-cell",
"label": {
"en": "Thyrotropic cell"
},
"description": {
"en": "Thyrotropic cells produce thyrotropin (thyroid-stimulating hormone)."
},
"roles": {
"en": [
"thyrotropin production"
]
},
"keywords": [
"thyrotropin"
],
"locations": [
"anterior pituitary",
"lobus anterior hypophysis"
],
"germlayer": "endoderm",
"category": "hormone-secreting cell",
"aliases": {
"en": [
"thyrotropic cell",
"thyrotropic cells",
"thyrotrope",
"thyrotropes",
"thyrotroph",
"thyrotrophs"
],
},
},
"score": 1,
"position": {
"sentence": 0,
"word": 5,
"begin": 28,
"end": 39
}
}]
}, {
input: "I am studying the gastric delomorphous cell, I will publish the paper soon",
expected: [{
"ngram": "gastric delomorphous cell",
"value": {
"id": "gastric-gland-oxyntic-cell",
"label": {
"en": "Gastric gland oxyntic cell"
},
"description": {
"en": "Gastric gland oxyntic cells are epithelial cells that secrete hydrochloric acid."
},
"roles": {
"en": [
"gastric factor secretion",
"intrinsic factor secretion",
"hydrochloric acid secretion"
]
},
"keywords": [
"hydrochloric acid",
"gastric factor",
"intrinsic factor"
],
"locations": [
"glandulae gastricae",
"stomach",
"ventriculus"
],
"latine-name": "exocrinocytus parietalis",
"germlayer": "endoderm",
"category": "exocrine secretory epithelial cell",
"aliases": {
"en": [
"parietal cell",
"parietal cells",
"delomorphous cell",
"delomorphous cells",
"oxyntic cell",
"oxyntic cells",
"gastric delomorphous cell",
"gastric delomorphous cells",
"gastric oxyntic cell",
"gastric oxyntic cells",
"gastric glands oxyntic cell",
"gastric glands oxyntic cells",
"gastric gland oxyntic cell",
"gastric gland oxyntic cells"
],
},
},
"score": 1,
"position": {
"sentence": 0,
"word": 4,
"begin": 18,
"end": 43
}
}]
}]
test('extract cells', () => Promise.all(
testData.map(async ({
input,
expected
}) => expect(await parse(input)).toEqual(expected))
))