Skip to content

Commit

Permalink
Merge pull request #5 from ghsnd/fix-new-keyword-types
Browse files Browse the repository at this point in the history
Added "index terms" to indicate a key words section.
  • Loading branch information
Dominika Tkaczyk committed Mar 19, 2015
2 parents 75f47fe + 2d9b21b commit df3a950
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 df3a950

Please sign in to comment.