commit aa5e8c9559d33dd8d3bd6410357356bc19eee1c3 Author: Tanmai Khanna Date: Tue Jun 18 23:34:43 2019 +0530 Completed C Anaphora Module | Deals with escaped characters diff --git a/src/anaphora.cc b/src/anaphora.cc index d42edf3..8e3ef9a 100644 --- a/src/anaphora.cc +++ b/src/anaphora.cc @@ -126,9 +126,9 @@ int main() fprintf(stdout, "%c", input_char); } - - input_char = fgetc(stdin); } + + input_char = fgetc(stdin); } //fclose(fin); diff --git a/src/parse_biltrans.cc b/src/parse_biltrans.cc index 5b77d3d..77b1f9b 100644 --- a/src/parse_biltrans.cc +++ b/src/parse_biltrans.cc @@ -33,7 +33,7 @@ LexicalUnit::LexicalUnit(vector input_LU) sl_form.push_back(*i); } } - else //tl + else if(seenSlash == 1) //tl (only first entry) { if(seenTag == 1) //in a tag { @@ -50,6 +50,10 @@ LexicalUnit::LexicalUnit(vector input_LU) tl_form.push_back(*i); } } + else + { + break; + } } else if(*i == '/') @@ -78,7 +82,7 @@ LexicalUnit::LexicalUnit(vector input_LU) } } - else //tl + else if(seenSlash == 1) //tl (only first entry in tl) { tl_form.push_back(*i); //add to the tl form @@ -100,6 +104,11 @@ LexicalUnit::LexicalUnit(vector input_LU) } } } + + else //if tl has more than one entry + { + break; + } } } @@ -123,7 +132,7 @@ vector< vector > LexicalUnit::get_tl_tags() return tl_tags; } -/* Uncomment to test this code +/* //Uncomment to test this code void print(vector const &input) { @@ -174,4 +183,3 @@ int main() */ -