Last active
August 29, 2015 14:15
-
-
Save tomelm/fed102b7a338644adba7 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
{ | |
"query" : "cheap restaurants", | |
"language" : "en", | |
"queryAnnotations" : [ | |
{ | |
"type" : "RawTokenQueryAnnotation", | |
"offset" : 0, | |
"length" : 5, | |
"queryText" : "cheap" | |
}, | |
{ | |
"type" : "RawTokenQueryAnnotation", | |
"offset" : 6, | |
"length" : 11, | |
"queryText": "restaurants" | |
}, | |
{ | |
"type" : "AttributeQueryAnnotation", | |
"offset" : 0, | |
"length" : 5, | |
"attribute" : "$", | |
"queryText" : "cheap", | |
"confidence" : 1.0 | |
} | |
] | |
} |
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 Soxhlet { | |
private final List<QueryTransformer> queryTransformers; | |
public RichQuery extract(PoorQuery poorQuery) { | |
// Step 1: Build the initial rich query. | |
RichQuery richQuery = new RichQuery(poorQuery); | |
// Step 2: Apply query transformations. | |
for (QueryTransformer qf : this.queryTransformers) { | |
richQuery = qf.transform(richQuery); | |
} | |
// Step 3: Profit. | |
return richQuery; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment