Skip to main content
. 2023 Jul 22;25(7):1097. doi: 10.3390/e25071097
Algorithm 1: Find Entity
Input: root: Node, sentence: String
Output: entities: List
1:  curNode ← root; index ← 0; maxLength ← 10; entities ← [ ]
2: while index < len(sentence) do:
3:  j ← maxLength
4:  while j ! = 0 then
5:   word ← sentence [index: index + j]
6:   if SeachWord(root, word) = True then
7:        index ← index + j − 1; entities.add(word);
8:   end if
9:   j ← j − 1
10:   end while
11:   index ← index + 1
12: end while
13: return entities