commit 7721bff7a5408d61ab8a63c088134807f3e43f1c Author: Tanmai Khanna Date: Fri Jul 5 17:15:40 2019 +0530 Agreement function implemented diff --git a/src/score.cc b/src/score.cc index cd4e6d1..4203db2 100644 --- a/src/score.cc +++ b/src/score.cc @@ -103,9 +103,28 @@ void Scoring::apply_indicators(unique_LU anaphor) { if(contains((*j).pos_tags, L"n")) { - - wcout<<(*j).wordform; - cout << ": " << (*j).score << "\n"; + unique_LU antecedent = *j; //create a temp copy of the potential antecedent + + //Check Agreement + if(check_agreement(antecedent.pos_tags, anaphor.pos_tags)) + { + //Add or Remove Indicators Here + + + //Boosting Indicators + + + //Impeding Indicators + + wcout << antecedent.wordform; + cout << ": " << antecedent.score << "\n"; + } + else + { + cout << "\nAgreement Failed for:"; + wcout << antecedent.wordform; + cout << "\n"; + } } } @@ -114,17 +133,30 @@ void Scoring::apply_indicators(unique_LU anaphor) } } -/* +int Scoring::check_agreement(vector antecedent_tags, vector anaphor_tags) +{ + if(contains(anaphor_tags, L"f") && contains(antecedent_tags, L"m")) + return 0; -void Scoring::referential_distance() + if(contains(anaphor_tags, L"m") && contains(antecedent_tags, L"f")) + return 0; + + if(contains(anaphor_tags, L"sg") && contains(antecedent_tags, L"pl")) + return 0; + + if(contains(anaphor_tags, L"pl") && contains(antecedent_tags, L"sg")) + return 0; + + return 1; +} + +/* +void Scoring::referential_distance(int distance) { - for(vector::iterator it=antecedent_list.begin();it!=antecedent_list.end();++it) - { - if((*it).score > -1) //-1 is minimum score - (*it).score--; - } + } + wstring Scoring::get_antecedent() { antecedent final_antecedent = {0, L"", -5}; diff --git a/src/score.h b/src/score.h index 7c978de..af846f1 100644 --- a/src/score.h +++ b/src/score.h @@ -31,6 +31,7 @@ private: public: void add_word(unsigned int input_id, wstring input_wordform, vector< wstring > pos_tags, wstring input_tl_wordform); void apply_indicators(unique_LU anaphor); + int check_agreement(vector antecedent_tags, vector anaphor_tags); //void referential_distance(); //wstring get_antecedent(); void clear();