+extern "C" CAMLprim value caml_text_collection_empty_text(value tc,value id){
+ CAMLparam2(tc,id);
+ CAMLreturn ( Val_int(((TextCollection*) tc)->EmptyText((DocID) Int_val(id))));
+}
+
+extern "C" CAMLprim value caml_text_collection_is_contains(value tc,value str){
+ CAMLparam2(tc,str);
+ uchar * cstr = (uchar *) String_val(str);
+ CAMLreturn ( Val_bool((int) ((TextCollection*) tc)->IsContains(cstr)));
+}
+
+extern "C" CAMLprim value caml_text_collection_count_contains(value tc,value str){
+ CAMLparam2(tc,str);
+ uchar * cstr = (uchar *) String_val(str);
+ CAMLreturn ( Val_int(((TextCollection*) tc)->CountContains(cstr)));
+
+}
+
+extern "C" CAMLprim value caml_text_collection_contains(value tc,value str){
+ CAMLparam2(tc,str);
+ CAMLlocal1(resarray);
+ uchar * cstr = (uchar *) String_val(str);
+ std::vector<DocID> results;
+ results = ((TextCollection*) tc)->Contains(cstr);
+
+ resarray = caml_alloc_tuple(results.size());
+
+ for (int i=0; i<results.size();i++){
+ caml_initialize(&Field(resarray,i),Val_int(results[i]));
+ };
+ CAMLreturn (resarray);
+}
+