This is an automated email from the ASF dual-hosted git repository.
koji pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/opennlp.git
The following commit(s) were added to refs/heads/master by this push:
new 98d6d15 OPENNLP-1139: BilouCodec should use its own constants (#270)
98d6d15 is described below
commit 98d6d15235e046762f3b09294e896994f616627c
Author: Koji Sekiguchi <[email protected]>
AuthorDate: Wed Oct 4 10:20:17 2017 +0900
OPENNLP-1139: BilouCodec should use its own constants (#270)
Thanks everyone for reviewing this!
---
.../src/main/java/opennlp/tools/namefind/BilouCodec.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/opennlp-tools/src/main/java/opennlp/tools/namefind/BilouCodec.java
b/opennlp-tools/src/main/java/opennlp/tools/namefind/BilouCodec.java
index 50cc4bf..5d24cd2 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/namefind/BilouCodec.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/namefind/BilouCodec.java
@@ -42,11 +42,11 @@ public class BilouCodec implements SequenceCodec<String> {
List<Span> spans = new ArrayList<>(c.size());
for (int li = 0; li < c.size(); li++) {
String chunkTag = c.get(li);
- if (chunkTag.endsWith(BioCodec.START)) {
+ if (chunkTag.endsWith(BilouCodec.START)) {
start = li;
end = li + 1;
}
- else if (chunkTag.endsWith(BioCodec.CONTINUE)) {
+ else if (chunkTag.endsWith(BilouCodec.CONTINUE)) {
end = li + 1;
}
else if (chunkTag.endsWith(LAST)) {
@@ -67,24 +67,24 @@ public class BilouCodec implements SequenceCodec<String> {
@Override
public String[] encode(Span[] names, int length) {
String[] outcomes = new String[length];
- Arrays.fill(outcomes, BioCodec.OTHER);
+ Arrays.fill(outcomes, BilouCodec.OTHER);
for (Span name : names) {
if (name.length() > 1) {
if (name.getType() == null) {
- outcomes[name.getStart()] = "default" + "-" + BioCodec.START;
+ outcomes[name.getStart()] = "default" + "-" + BilouCodec.START;
}
else {
- outcomes[name.getStart()] = name.getType() + "-" + BioCodec.START;
+ outcomes[name.getStart()] = name.getType() + "-" + BilouCodec.START;
}
// now iterate from begin + 1 till end
for (int i = name.getStart() + 1; i < name.getEnd() - 1; i++) {
if (name.getType() == null) {
- outcomes[i] = "default" + "-" + BioCodec.CONTINUE;
+ outcomes[i] = "default" + "-" + BilouCodec.CONTINUE;
}
else {
- outcomes[i] = name.getType() + "-" + BioCodec.CONTINUE;
+ outcomes[i] = name.getType() + "-" + BilouCodec.CONTINUE;
}
}
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].