Created
April 29, 2013 17:22
-
-
Save JnBrymn/5483176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SwanQueries { | |
static int MAX_PARAGRAPH_LENGTH = 5000; | |
static int MAX_SENTENCE_LENGTH = 500; | |
public static SpanQuery SAME(SpanQuery left,SpanQuery right) { | |
return new SpanNearQuery( | |
new SpanQuery[] { left, right }, | |
MAX_PARAGRAPH_LENGTH, true); | |
} | |
public static SpanQuery WITH(SpanQuery left,SpanQuery right) { | |
return new SpanNearQuery( | |
new SpanQuery[] { left, right }, | |
MAX_SENTENCE_LENGTH, true); | |
} | |
public static SpanQuery ADJ(SpanQuery left,SpanQuery right) { | |
return new SpanNearQuery( | |
new SpanQuery[] { left, right }, | |
1, true); | |
} | |
public static SpanQuery NEAR(SpanQuery left,SpanQuery right) { | |
return new SpanNearQuery( | |
new SpanQuery[] { left, right }, | |
1, false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment