Skip to content

Commit

Permalink
Added "index terms" to indicate a key words section.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghsnd committed Mar 17, 2015
1 parent 75f47fe commit 2d9b21b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cermine-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<packaging>jar</packaging>
<name>CERMINE Engine Implementation - ${project.version}</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<profiles>
<profile>
<id>full</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public class KeywordsEnhancer extends AbstractSimpleEnhancer {

private static final Pattern PREFIX = Pattern.compile("^key\\s?words[:-]?", Pattern.CASE_INSENSITIVE);
private static final Pattern PREFIX = Pattern.compile("^key\\s?words[:-—]?|^index terms[:-—]?", Pattern.CASE_INSENSITIVE);

public KeywordsEnhancer() {
setSearchedZoneLabels(EnumSet.of(BxZoneLabel.MET_KEYWORDS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class KeywordsFeature extends FeatureCalculator<BxZone, BxPage> {

@Override
public double calculateFeatureValue(BxZone zone, BxPage page) {
String[] keywords = {"keywords", "key words"};
String[] keywords = {"keywords", "key words", "index terms"};

for (String keyword : keywords) {
if (zone.toText().toLowerCase().startsWith(keyword)) {
Expand Down

0 comments on commit 2d9b21b

Please sign in to comment.