Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Head coverage bug + regex bug in KB #19

Merged
merged 2 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion kb/src/main/java/amie/data/KB.java
Original file line number Diff line number Diff line change
Expand Up @@ -3741,9 +3741,13 @@ public static int[] triple(CharSequence... triple) {
public static final Pattern triplePattern = Pattern
.compile("(\\w+)\\((\\??\\w+)\\s*,\\s*(\\??\\w+)\\)");

private static final String uriPattern = "<?[-._\\p{L}:/–'\\(\\),]+>?";
/** We do not still support typed literals **/
private static final String literalPattern = "\\\"?[-._\\p{L}\\s,'–:/]+\\\"?(@\\w+)?";

/** Pattern of a triple */
public static final Pattern amieTriplePattern = Pattern
.compile("(\\??\\w+|<[-_\\w\\p{L}/:–'.\\(\\),]+>)\\s+(<?[-_\\w:\\.]+>?)\\s+(\"?[-_\\w\\s,'.–:]+\"?(@\\w+)?|\\??\\w+|<?[-_\\w\\p{L}/:–'.\\(\\)\\\"\\^,]+>?)");
.compile("(\\?\\w+|" + uriPattern + ")\\s+(\\\\??\\\\w+|" + uriPattern + ")\\s+(" + literalPattern + "|\\?\\w+|" + uriPattern + ")");


/**
Expand Down
1 change: 1 addition & 0 deletions mining/src/main/java/amie/mining/AMIE.java
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,7 @@ public static AMIE getInstance(String[] args)
default:
metric = Metric.HeadCoverage;
System.err.println("Using " + metric + " as pruning metric with threshold " + minHeadCover);
minMetricValue = minHeadCover;
break;
}
} else {
Expand Down
6 changes: 1 addition & 5 deletions typing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
<artifactId>commons-math3</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>uk.co.nildram</groupId>
<artifactId>jsc</artifactId>
<version>1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jsc/jsc -->
</dependencies>

<build>
Expand Down