blob: f4da76fb98f4bb8442fe48ef02cbed018a8ccc87 [file] [log] [blame]
alexander.behmc576c602012-07-06 02:41:15 +00001/*
2 * Description : Tests that the FuzzyEqRule rewrites ~= using Jaccard
3 * into edit-distance-check.
4 * Success : Yes
5 */
6
7drop dataverse test if exists;
8create dataverse test;
9use dataverse test;
10
11create type DBLPType as closed {
12 id: int32,
13 dblpid: string,
14 title: string,
15 authors: string,
16 misc: string
17}
18
19create dataset DBLP(DBLPType) partitioned by key id;
20
21load dataset DBLP
22using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
23(("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
24
25write output to nc1:"rttest/similarity_fuzzyeq-to-jaccard-check.adm";
26
27set simfunction 'jaccard';
28set simthreshold '0.8f';
29
30// Tests two rules: FuzzyEqRule and SimilarityCheckRule
31for $paper in dataset('DBLP')
32where word-tokens($paper.title) ~= word-tokens("Transactions for Cooperative Environments")
33return $paper