Skip to content

Commit

Permalink
Changed DiffMatchPatch algorithm to include start indexes of differen…
Browse files Browse the repository at this point in the history
…ces, allowing the retrieval of these differences in the original document to collect accurate snippets.
  • Loading branch information
EdDuarte committed Jun 25, 2016
1 parent 0634468 commit 1aa8998
Show file tree
Hide file tree
Showing 39 changed files with 2,103 additions and 695 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The following list shows all possible responses:
| 400 | 1 | The provided document URL is invalid. |
| 400 | 2 | The provided client URL is invalid. |
| 400 | 3 | You need to provide at least one valid keyword. |
| 400 | 4 | At least one difference action ('added' or 'removed') must not be ignored. |
| 400 | 4 | At least one difference event ('added' or 'removed') must not be ignored. |
| 409 | 5 | The request conflicts with a currently active watch job, since the provided document URL is already being watched and notified to the provided client URL. |
| 415 | 6 | The request body has an invalid format. |
| 404 | 7 | The specified job to cancel does not exist. |
Expand All @@ -133,12 +133,12 @@ When detected differences are matched with keywords, Vokter sends notifications
"url": "http://www.example.com",
"diffs": [
{
"action": "added",
"event": "added",
"keyword": "argus",
"snippet": "In the 5th century and later, Argus' wakeful alertness ..."
},
{
"action": "removed",
"event": "removed",
"keyword": "argus",
"snippet": "... sacrifice of Argus liberated Io and allowed ..."
}
Expand Down
8 changes: 0 additions & 8 deletions vokter-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,6 @@
</dependency>


<!-- ContentType class (detect content type of web document) -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.2</version>
</dependency>


<!-- other utils -->
<dependency>
<groupId>commons-validator</groupId>
Expand Down
12 changes: 6 additions & 6 deletions vokter-core/src/main/java/com/edduarte/vokter/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@

package com.edduarte.vokter;

import com.edduarte.vokter.diff.Difference;
import com.edduarte.vokter.model.mongodb.Difference;
import com.edduarte.vokter.diff.DifferenceDetector;
import com.edduarte.vokter.document.Document;
import com.edduarte.vokter.model.mongodb.Document;
import com.edduarte.vokter.document.DocumentBuilder;
import com.edduarte.vokter.document.DocumentCollection;
import com.edduarte.vokter.job.JobManager;
import com.edduarte.vokter.job.JobManagerHandler;
import com.edduarte.vokter.keyword.Keyword;
import com.edduarte.vokter.model.mongodb.Keyword;
import com.edduarte.vokter.keyword.KeywordBuilder;
import com.edduarte.vokter.parser.Parser;
import com.edduarte.vokter.parser.ParserPool;
import com.edduarte.vokter.parser.SimpleParser;
import com.edduarte.vokter.model.v1.SubscribeRequest;
import com.edduarte.vokter.model.v1.rest.SubscribeRequest;
import com.mongodb.BulkWriteOperation;
import com.mongodb.DB;
import com.mongodb.DBCollection;
Expand Down Expand Up @@ -137,12 +137,12 @@ public class Context implements LifeCycle.Listener, JobManagerHandler {
/**
* Flag that sets difference detection jobs to perform stopword filtering.
*/
private boolean isStoppingEnabled = true;
private boolean isStoppingEnabled = false;

/**
* Flag that sets difference detection jobs to perform stemming.
*/
private boolean isStemmingEnabled = true;
private boolean isStemmingEnabled = false;

/**
* Flag that sets difference detection jobs to of equal occurrences with different casing.
Expand Down
Loading

0 comments on commit 1aa8998

Please sign in to comment.