commit 5e2333820f22a1be75070b0eca02cdcb07a64653 Author: Tanmai Khanna Date: Thu Jul 4 20:25:22 2019 +0530 Implemented Application of Indicators and flow of scoring diff --git a/src/score.cc b/src/score.cc index 570791a..cd4e6d1 100644 --- a/src/score.cc +++ b/src/score.cc @@ -86,19 +86,35 @@ void Scoring::add_word(unsigned int input_id, wstring input_wordform, vector< ws } else if( contains(input_LU.pos_tags, L"det") && contains(input_LU.pos_tags, L"pos") ) { - //apply_indicators(input_LU); - showq(context); + apply_indicators(input_LU); } } } -/* + void Scoring::apply_indicators(unique_LU anaphor) { - //Start going through sentences(current to earliest) and apply all indicators to modify scores of the NPs + int distance_marker = 2; //starts from 2 for current sentence and reduces till -1 as we go to previous sentences -} + //Start going through sentences(current to earliest) and apply all indicators to modify scores of the NPs + for(deque< vector >::reverse_iterator i = context.rbegin(); i!=context.rend(); ++i) //read through the queue in reverse + { + cout<<"\nSentence:" << distance_marker << "\n"; + for (vector::iterator j = (*i).begin(); j!=(*i).end(); ++j) //read through sentence + { + if(contains((*j).pos_tags, L"n")) + { + + wcout<<(*j).wordform; + cout << ": " << (*j).score << "\n"; + } + } + if(distance_marker > -1) + distance_marker--; + } +} +/* void Scoring::referential_distance() { diff --git a/src/score.h b/src/score.h index edd9ac0..7c978de 100644 --- a/src/score.h +++ b/src/score.h @@ -26,11 +26,11 @@ class Scoring { private: deque< vector > context; //A queue of sentences. Each sentence is a vector of Lexical Units - //unique_LU anaphor; - //vector antecedent_list; //A list of antecedents + vector antecedent_list; //A list of antecedents 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); //void referential_distance(); //wstring get_antecedent(); void clear();