← Back to team overview

team4alfanous team mailing list archive

[Branch ~team4alfanous/alfanous/alfanous-git] Rev 471: fix a bug in retrieving annotations when there are terms from another

 

------------------------------------------------------------
revno: 471
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Thu 2013-01-03 11:13:48 +0100
message:
  fix a bug in retrieving annotations when there are terms from another
  field then "aya" field
modified:
  src/alfanous/Outputs.py


--
lp:alfanous
https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git

Your team Alfanous team is subscribed to branch lp:alfanous.
To unsubscribe from this branch go to https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git/+edit-subscription
=== modified file 'src/alfanous/Outputs.py'
--- src/alfanous/Outputs.py	2013-01-02 14:18:45 +0000
+++ src/alfanous/Outputs.py	2013-01-03 10:13:48 +0000
@@ -537,9 +537,9 @@
 					words_output[ "individual" ][ cpt ] = {
 														 "word":term[1],
 														 "buckwalter": buck2uni( term[1], ignore = "" , reverse = True ),
-														 "nb_matches":term[2], 
-														 "nb_ayas":term[3], 
-														 "nb_vocalizations": len( vocalizations ), 
+														 "nb_matches":term[2],
+														 "nb_ayas":term[3],
+														 "nb_vocalizations": len( vocalizations ),
 														 "vocalizations": vocalizations
 														 }
 					cpt += 1
@@ -607,7 +607,7 @@
 
 		## merge word annotations to word output
 		if ( annotation_word and word_info ):
-			for cpt in xrange( 1, len( termz ) + 1 ):
+			for cpt in xrange( 1, len( output["words"]["individual"] ) + 1 ):
 				current_word = STANDARD2UTHMANI( output["words"]["individual"][cpt]["word"] )
 				#print current_word.encode( "utf-8" ), "=>", annotations_by_word, "=>", list( annot_res )
 				if annotations_by_word.has_key( current_word ):