SIGMOD Contest 2013
Loading...
Searching...
No Matches
core.h
Go to the documentation of this file.
1/*
2 * core.h version 1.0
3 * Copyright (c) 2013 KAUST - InfoCloud Group (All Rights Reserved)
4 * Authors: Amin Allam, Fuad Jamour
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following
13 * conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 *
27 * Current version: 1.1 (Feb 13, 2013)
28 *
29 * Version history:
30 * - 1.1 (Feb 13, 2013)
31 * * Fixed C incompatibility in enum definitions
32 * - 1.0 (Feb 1, 2013)
33 * * Initial release
34 */
35
36#ifndef __SIGMOD_CORE_H_
37#define __SIGMOD_CORE_H_
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
44//*********************************************************************************************
45
47#define MAX_DOC_LENGTH (1<<22)
48
50#define MAX_WORD_LENGTH 31
51
53#define MIN_WORD_LENGTH 4
54
56#define MAX_QUERY_WORDS 5
57
59#define MAX_QUERY_LENGTH ((MAX_WORD_LENGTH+1)*MAX_QUERY_WORDS)
60
61
63typedef unsigned int QueryID;
64
66typedef unsigned int DocID;
67
68
89
109
111//*********************************************************************************************
112
118
126
164 const char* query_str,
165 MatchType match_type,
166 unsigned int match_dist);
167
180
203 const char* doc_str);
204
235 unsigned int* p_num_res,
236 QueryID** p_query_ids);
237
239//*********************************************************************************************
240
241#ifdef __cplusplus
242}
243#endif
244
245#endif // __SIGMOD_CORE_H_
ErrorCode GetNextAvailRes(DocID *p_doc_id, unsigned int *p_num_res, QueryID **p_query_ids)
Return the next available active queries subset that matches any previously submitted document,...
ErrorCode InitializeIndex()
Called only once at the beginning of the whole test.
ErrorCode
Error codes:
Definition core.h:91
@ EC_NO_AVAIL_RES
Must be returned only if there is no available result to be returned by GetNextAvailRes().
Definition core.h:101
@ EC_SUCCESS
Must be returned by each core function unless specified otherwise.
Definition core.h:95
@ EC_FAIL
Used only for debugging purposes, and must not be returned in the final submission.
Definition core.h:106
MatchType
Matching types:
Definition core.h:70
@ MT_EDIT_DIST
Two words match if one of them can can be transformed into the other word by inserting,...
Definition core.h:86
@ MT_HAMMING_DIST
Two words match if they have the same number of characters, and the number of mismatching characters ...
Definition core.h:80
@ MT_EXACT_MATCH
Two words match if they are exactly the same.
Definition core.h:74
ErrorCode StartQuery(QueryID query_id, const char *query_str, MatchType match_type, unsigned int match_dist)
Add a query (associated with matching type) to the active query set.
ErrorCode EndQuery(QueryID query_id)
Remove a query from the active query set.
ErrorCode MatchDocument(DocID doc_id, const char *doc_str)
Push a document to the server.
unsigned int DocID
Document ID type.
Definition core.h:66
unsigned int QueryID
Query ID type.
Definition core.h:63
ErrorCode DestroyIndex()
Called only once at the end of the whole test.