check 7.15 KB
Newer Older
priyank's avatar
priyank committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
9a10
> 
12,14d12
< #$SSF_API = $ENV{'SSF_API'};
< 
< #require "$SSF_API/feature_filter.pl";
49,50d46
< 		# All if loop can be change to if else and some 
< 		#variables(like visible,flags etc) are used
129a126
> #print STDERR "End TB $pnum\n";
175,179c172,174
< 			# Litha Changes
< 			# Orignal Statement
< 		#	open(OUT, ">tmp/sentSSF.$$") or die("could not open to write\n");
< 			my @sent = "";
< 			my $j = 0;
---
> 			print STDERR "$pnum-$sentnum-$cur_sent_id\n";
> 
> 			open(OUT, ">tmp/sentSSF.$$") or die("could not open to write\n");
183,185c178
< 			# Litha Changes
< 			# Orignal Statement
< 			#close(OUT);
---
> 			close(OUT);
188,191c181
< 			# Litha Changes
< 			# Orignal Statement
< 			#$tRee = &read("tmp/sentSSF.$$");
< 			$tRee = &read(\@sent);
---
> 			$tRee = &read("tmp/sentSSF.$$");
193a184
>                        # $sentf = 0;
198a190,191
> 		#	$pf = 0;
>                 #        $sentnum = 0;
216,220c209
< 			       # Litha Changes
<                                # Orignal Statement
<                                # open(OUT, ">tmp/sentSSF.$$") or die("could not open to write\n");
<                                my @sent = "";
<                                my $j = 0;
---
> 			       open(OUT, ">tmp/sentSSF.$$") or die("could not open to write\n");
225,228c214
< 			# Litha Changes
<                         # Orignal Statement
< 			# print OUT "$all_lines[$i]\n";
< 			@sent[$j++]= "$all_lines[$i]\n";
---
> 			print OUT "$all_lines[$i]\n";
236,238c222
< 		# Litha Changes
<                 # Orignal Statement
< 		# close(OUT);
---
> 		close(OUT);
241,244c225
< 		# Litha Changes
<                 # Orignal Statement
<                 # $tRee = &read("tmp/sentSSF.$$");
<                 $tRee = &read(\@sent);
---
>                 $tRee = &read("tmp/sentSSF.$$");
304,305c285,286
< 			print "\ntb_num is available.But user is not providing the tb_num: $tb_no\n";
< 			print "sentence_id: $sent_id is present in the tb_num: $tb_no \n";
---
> 			print "\ntb is available.But user is not providing the tb_no:\n";
> 			print "\ntb_ num: $tb_no\tSentence_id: $sent_id"."\n\n";
308,309c289,300
< 		print "\ntb_ num: $tb_no\tSentence_id: $sent_id"."\n\n";
< 
---
> 		if($tb_no == $pnum)
> 		{
> 			print "\ntb_ num: $tb_no\tSentence_id: $sent_id"."\n\n";
> 		}
> 		else{
> 			if($pnum)
> 			{
> 				print "\ntb_num is available, tb_num= $pnum";
> 				print "but user is not providing tb_num";
> 				print "\nSentence_id: $sent_id"."\n\n";
> 			}
> 		}
315c306
< 		if(!$paraf)
---
> 		if(($paraf) && ($pnum == 0))
317c308
< 			print "\nError : tb_num is not available.But user is providing the tb_num:\n\n";
---
> 			print "\nError : tb is available.But user is not providing the tb_no:\n";
319c310
< 		elsif(($paraf) && ($pnum == 0))
---
> 		elsif($paraf && $sentf)
321,322c312
< 			print "\nError : tb_num is available.But user is not providing the tb_num.\n";
< 			print "Sentence_id: $sent_id is not present in the all tb_nums: \n\n"
---
> 			print "Sentence_id is not present in the tb_no : $pnum\n\n";
326c316
< 			print "\nSentence_id: $sent_id is not present in the tb_num : $pnum\n\n";
---
> 			print "\nError : tb is not available.But user is providing the tb_no:\n\n";
453,454c443,444
< 	
< 	# Litha Changes up to end of this function	
---
> 
> 	# Litha Changes	
474a465
> 			# Sriram Changes
489a481,482
> 					#print "<Sentence id=\"$sentcount\">\n";
> 					#print "<Sentence id=\"".join('==',@{$para->[0]->{'sent_Ids'}})."\">\n";
526,527c519,520
< 	# Litha Changes upto end of the program
<         print OUT "$StoryRef->[0]->{\"first_line\"}$StoryRef->[0]->{\"second_line\"}$StoryRef->[0]->{\"third_line\"}$StoryRef->[0]->{\"meta\"}";
---
> 
>         print OUT "$StoryRef->[0]->{\"first_line\"}\n\n$StoryRef->[0]->{\"second_line\"}\n\n$StoryRef->[0]->{\"third_line\"}\n\n$StoryRef->[0]->{\"meta\"}\n";
532,538c525,533
<                 my $paras = $StoryRef->[$i];
< 		if($paras->[0]->{'body_visible'} == 1)
<                 {
<                 	print OUT "<body>\n\n";
< 		}
< 		my $paracount = &get_paracount($paras);
< 		for(my $j = 1; $j <= $paracount; $j++)
---
>                 print OUT "<body>\n\n";
>                 my $para = $StoryRef->[$i];
> 
> 		# INformation is there in  $StoryRef->[1]->[$paranum]->[0]->
> 		my $segment = $para->[0]->{'segment'};
> 		my $bullet =  $para->[0]->{'bullet'};
> 		my $lang =  $para->[0]->{'language'};
> 
>                 for(my $j = 1; $j <= $para->[0]->{'numSens'}; $j++)
540,552c535,543
<                         my $para = $paras->[$j];
< 			my $segment = $para->[0]->{'segment'};
< 			my $bullet =  $para->[0]->{'bullet'};
< 			my $lang =  $para->[0]->{'language'};
< 			if($para->[0]->{'para_visible'} == 1)
<                         {
< 				print OUT "<tb number=\"$j\" segment=\"$segment\" bullet=\"$bullet\">\n";
< 			}
< 			if($para->[0]->{'text_visible'} == 1)
<                         {
< 				print OUT "<text>\n";
< 			}
< 			for(my $k = 1; $k <= $para->[0]->{'numSens'}; $k++)
---
>                         my $sentences = $para->[$j];
>         #                print OUT "<p>\n";
> 					
> 			print OUT "<tb number=\"$j\" segment=\"$segment\" bullet=\"$bullet\">\n";
> 			#print OUT "<tb number=\"$j\" segment=\"yes\" bullet=\"yes\">\n";
> 			print OUT "<text>\n";
>                         #print OUT "<tb>\n";
> 
>                         for(my $k = 1; $k <= $sentences->[0]; $k++)
555,560c546,548
<                                 if($para->[0]->{'sent_visible'} == 1)
<                                 {
< 					 print OUT "<Sentence id=\"".$para->[0]->{'sent_Ids'}->[$k]."\">\n";
< 					close(OUT);
< 				}
<                                 &print_tree_file(">>$outfile", $para->[$k]);
---
>                                 print OUT "<Sentence id=\"$sentcount\">\n";
> 				close(OUT);
>                                 &print_tree_file(">>$outfile", $sentences->[$k]);
562,565c550
< 				if($para->[0]->{'sent_visible'} == 1)
<                                 {
<                                 	print OUT "</Sentence>\n";
< 				}
---
>                                 print OUT "</Sentence>\n";
567,575c552,554
< 			if($para->[0]->{'text_visible'} == 1)
<                         {
< 				print OUT "</text>\n";
< 				print OUT "<foreign language=\"select\" writingsystem=\"LTR\"></foreign>\n";
< 			}
< 			if($para->[0]->{'para_visible'} == 1)
<                         {
<                         	print OUT "</tb>\n";
< 			}
---
> 			print OUT "</text>\n";
> 			print "<foreign language=\"select\" writingsystem=\"LTR\"></foreign>\n";
>                         print OUT "</tb>\n";
577,580d555
< 		if($paras->[0]->{'body_visible'} == 1)
<                 {
<         		print OUT "</body>\n";
< 		}
582c557,560
< 	print OUT "$StoryRef->[0]->{\"last_line\"}";
---
> 
>         print OUT "</body>\n";
>         print OUT "</document>\n";
> 
630,639c608,614
< 	# Litha Changes
< 	# Orignal Statement
< 	# my $filename;
< 	# $filename=$_[0];
< 	# if($filename)
< 	# {
< 	#	open(stdin,$filename) or die $!."\n";
< 	# }
< 	my $sent_ref;
< 	$sent_ref=shift;
---
> 	my $filename;
> 
> 	$filename=$_[0];
> 	if($filename)
> 	{
> 		open(stdin,$filename) or die $!."\n";
> 	}
650,653c625
< 	# Litha Changes
<         # Orignal Statement
< 	#while(<stdin>)
< 	foreach (@$sent_ref)
---
> 	while(<stdin>)