File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ type Features struct {
25
25
// Abbr feature: token ends with a period.
26
26
Abbr bool
27
27
28
+ // HasAnnotation is true if there is an apparent nomenclatural annotation
29
+ // attached to a name candidate. This feature can only be set for the
30
+ // first token of a candidate.
31
+ HasAnnotation bool
32
+
28
33
// PotentialBinomialGenus feature: the token might be a genus of name.
29
34
PotentialBinomialGenus bool
30
35
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ import (
13
13
"github.com/gnames/gnfinder/pkg/io/dict"
14
14
)
15
15
16
- // tokenSN represents a word separated by spaces in a text. Words that are
17
- // split by new lines are concatenated.
16
+ // tokenSN (a token for a 'Scientific Name') represents a word separated by
17
+ // spaces in a text. Words that are split by new lines are concatenated.
18
18
type tokenSN struct {
19
19
gner.TokenNER
20
20
@@ -218,10 +218,13 @@ func checkRank(t TokenSN, d *dict.Dictionary) bool {
218
218
219
219
// UpperIndex takes an index of a token and length of the tokens slice and
220
220
// returns an upper index of what could be a slice of a name. We expect that
221
- // that most of the names will fit into 5 words. Other cases would require
222
- // more thorough algorithims that we can run later as plugins.
221
+ // that most of the names will fit into 5 words. We also expect that annotation
222
+ // will be located not further away than 10 words away.
223
+ // Other cases would require more thorough algorithims that we can run
224
+ // later as plugins.
223
225
func UpperIndex (i int , l int ) int {
224
- upperIndex := i + 5
226
+ // 10 here is 5 tokens for name, 5 tokens for annotation
227
+ upperIndex := i + 10
225
228
if l < upperIndex {
226
229
upperIndex = l
227
230
}
You can’t perform that action at this time.
0 commit comments