Skip to content

Instantly share code, notes, and snippets.

@JnBrymn
Created April 29, 2013 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JnBrymn/5483176 to your computer and use it in GitHub Desktop.
Save JnBrymn/5483176 to your computer and use it in GitHub Desktop.
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