Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad88me committed Mar 27, 2020
1 parent 5b6d352 commit d56262e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ahmad88me/tadahdtentityexperiment:latest

WORKDIR /app

COPY scripts /app/scripts
COPY scripts /app/scripts
COPY src /app/src
COPY Makefile /app/Makefile
COPY .git /app/.git
Expand Down
13 changes: 0 additions & 13 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ int main(int argc, char* argv[]) {
string hdt_file, classes_file, files_dir, log_file="main.log";
if(argc<4) {
cerr << "Usage: " << argv[0] << "hdt_file classes_file files_dir " << std::endl;
// hdt_file = "/Users/aalobaid/workspaces/Cworkspace/tada-hdt/dbpedia_all.hdt";
// string class_uri = "http://dbpedia.org/ontology/Mountain";
// string fname = "/Users/aalobaid/workspaces/Pyworkspace/tada-gam/local_data/t2dv2/99070098_0_2074872741302696997.csv";

// EntityAnn* ea = new EntityAnn(hdt_file, log_file, 0.0);
// std::list<string>* candidates;
// std::list<std::list<string>*>* data;
// Parser p(fname);
// data = p.parse_vertical();
// candidates = ea->annotate_column(data, 1, true, true);
// ea->get_graph()->print_nodes();
// delete candidates;
// candidates = ea->recompute_f(0.1);
}
else if(argc==4) {
hdt_file = argv[1];
Expand Down
10 changes: 5 additions & 5 deletions src/t2dv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,17 @@ void T2Dv2::run_test(double from_alpha, double to_alpha, double step) {
// cout << (*it2) << "| ";
// }
m_logger->log("run_test> in for loop with length "+to_string((*it)->size()));
cout << "\n\n---------------\n";
// cout << "\n\n---------------\n";
col_iter = (*it)->begin();
fname = clean_str(*col_iter);
col_iter++;
col_id_str = clean_str(*col_iter);
col_id = static_cast<unsigned int>(stoul(col_id_str));
col_iter++;
class_uri = clean_str(*col_iter);
cout << "class_uri: <" << class_uri << ">"<<endl;
cout << "col_idx: <" << col_id_str <<">" <<endl;
cout << "fname: <"<<fname << ">"<<endl;
// cout << "class_uri: <" << class_uri << ">"<<endl;
// cout << "col_idx: <" << col_id_str <<">" <<endl;
// cout << "fname: <"<<fname << ">"<<endl;
ea = get_ea_model(fname, col_id, true);
// ea->get_graph()->print_nodes();
m_logger->log("run_test> got model of: "+fname);
Expand Down Expand Up @@ -385,7 +385,7 @@ double T2Dv2::get_median(std::list<double>* a){
// for(auto it=a->begin();it!=a->end();it++){
// cout<< *it << " - ";
// }
cout<<endl;
// cout<<endl;
len = a->size();
if(len%2==1){//odd
std::advance(b,len/2);
Expand Down
2 changes: 1 addition & 1 deletion src/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace {
string fname="Athletes1.csv";
string class_uri = dbo_prefix+"Athlete";
T2Dv2* t2d = new T2Dv2(hdt_file, log_file, "test_files/classes_test.csv", "test_files");
annotated_corr = t2d->evaluate_column(fname, class_uri, 0, true, 0.7);
annotated_corr = t2d->evaluate_column(fname, class_uri, 0, true, 0.8);
ASSERT_TRUE(annotated_corr);
k = t2d->get_k(fname);
ASSERT_EQ(k, 0);
Expand Down

0 comments on commit d56262e

Please sign in to comment.