← Back to team overview

team4alfanous team mailing list archive

[Branch ~team4alfanous/alfanous/alfanous-git] Rev 492: add a new flag in the API for romanization

 

------------------------------------------------------------
revno: 492
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Sat 2013-01-05 20:09:10 +0100
message:
  add  a new flag in the API for romanization
modified:
  src/alfanous-django/templates/results.html
  src/alfanous/Outputs.py
  src/alfanous/README.rst


--
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-django/templates/results.html'
--- src/alfanous-django/templates/results.html	2013-01-05 18:11:26 +0000
+++ src/alfanous-django/templates/results.html	2013-01-05 19:09:10 +0000
@@ -54,7 +54,7 @@
 						  <div class='word_details'>
 						    <span style=' font-size:14pt; color:#00aa00;'> {{ wordcpt }}.  </span>
 							<a class='no_decoration' href="?{% build_search_link params  wordstat.word 1 False %}"> 
-							<div class='details_label word_info0 clickable'> {{ _("word") }} | {{ wordstat.word }} | {{ wordstat.buckwalter }} </div></a>
+							<div class='details_label word_info0 clickable'> {{ _("word") }} | {{ wordstat.word }} {% if wordstat.romanization %} ( {{ wordstat.romanization }} ) {%  endif %} </div></a>
 							<div class='details_label word_stat0'> {{ _("occurnaces") }} | {{ wordstat.nb_matches }} </div>
 							<div class='details_label word_stat1'> {{ _("ayates") }} |  {{ wordstat.nb_ayas }} </div>
 							<div class='details_label word_vocalization_nb'> {{ _("vocalizations") }} | {{ wordstat.nb_vocalizations }} </div>

=== modified file 'src/alfanous/Outputs.py'
--- src/alfanous/Outputs.py	2013-01-05 14:00:49 +0000
+++ src/alfanous/Outputs.py	2013-01-05 19:09:10 +0000
@@ -89,8 +89,7 @@
 
 	TODO Add word annotations to results
 	FIXME terms are standard and Qurany corpus are uthmani   # resolve with uthmani mapping of Taha , + domains + errors
-	TODO statistics of use + update_stats.js
-	TODO status Messages ALL (code , message)
+	
 	"""
 
 	DEFAULTS = {
@@ -109,6 +108,7 @@
                   "view": "custom",
 			      "recitation": "1",
 			      "translation": None,
+			      "romanization": None,
 			      "prev_aya": False,
 			      "next_aya": False,
 			      "sura_info": True,
@@ -133,7 +133,8 @@
 	     - 1:"fail, reason unknown",
 	     0:"success",
 	     1:"no action is chosen or action undefined",
-	     2:"""SuperJokers are not permitted, you have to add  3 letters or more to use * and 2 letters or more to use ? (؟)\n
+	     2:"""SuperJokers are not permitted, you have to add  3 letters 
+	           or more to use * and 2 letters or more to use ? (؟)\n
 	     	-- Exceptions: ? (1),  ??????????? (11)
 	     	"""
 	    }
@@ -151,6 +152,7 @@
                   "view":["minimal", "normal", "full", "statistic", "linguistic", "custom"],
 			      "recitation": [], #xrange( 30 ),
 			      "translation": [],
+			      "romanization": ["none", "buckwalter", "iso", "arabtex"], #arabizi is forbidden for show
 			      "prev_aya": [True, False],
 			      "next_aya": [True, False],
 			      "sura_info": [True, False],
@@ -162,7 +164,7 @@
 			      "aya_sajda_info":	[True, False],
 			      "annotation_word":[True, False],
 			      "annotation_aya":[True, False],
-			      "sortedby":["total", "score", "relevance", "mushaf", "tanzil", "subject", "ayalength"],
+			      "sortedby":["score", "relevance", "mushaf", "tanzil", "subject", "ayalength"],
 			      "offset":[], #xrange(6237)
 			      "range":[], # xrange(DEFAULTS["maxrange"]) , # used as "perpage" in paging mode
 			      "page":[], # xrange(6237),  # overridden with offset
@@ -183,6 +185,7 @@
                   "view": "pre-defined configuration for what information to retrieve",
 			      "recitation": "recitation id",
 			      "translation": "translation id",
+			      "romanization": "type of romanization",
 			      "prev_aya": "enable previous aya retrieving",
 			      "next_aya": "enable next aya retrieving",
 			      "sura_info": "enable sura information retrieving (override sura_stat_info if False)",
@@ -388,6 +391,8 @@
 					 else self._defaults["flags"]["recitation"]
 		translation = flags["translation"] if flags.has_key( "translation" ) \
 					  else self._defaults["flags"]["translation"]
+		romanization = flags["romanization"] if flags.has_key( "romanization" ) \
+					  else self._defaults["flags"]["romanization"]
 		highlight = flags["highlight"] if flags.has_key( "highlight" ) \
 					else self._defaults["flags"]["highlight"]
 		script = flags["script"] if flags.has_key( "script" ) \
@@ -427,6 +432,7 @@
 			aya_position_info = aya_theme_info = aya_sajda_info = True
 			aya_stat_info = sura_stat_info = True
 			annotation_aya = annotation_word = True
+			romanization = "iso"
 		elif view == "statistic":
 			prev_aya = next_aya = False
 			sura_info = True
@@ -447,6 +453,7 @@
 			sura_stat_info = False
 			annotation_aya = True
 			annotation_word = True
+			romanization = "buckwalter"
 		elif view == "recitation":
 			script = "uthmani"
 			prev_aya = next_aya = True
@@ -541,7 +548,7 @@
 					nb_vocalizations_globale += len( vocalizations )
 					words_output[ "individual" ][ cpt ] = {
 														 "word":term[1],
-														 "buckwalter": buck2uni( term[1], ignore = "" , reverse = True ),
+														 "romanization": buck2uni( term[1], ignore = "" , reverse = True ) if romanization == "buckwalter" else None,
 														 "nb_matches":term[2],
 														 "nb_ayas":term[3],
 														 "nb_vocalizations": len( vocalizations ),

=== modified file 'src/alfanous/README.rst'
--- src/alfanous/README.rst	2013-01-01 18:48:22 +0000
+++ src/alfanous/README.rst	2013-01-05 19:09:10 +0000
@@ -126,6 +126,7 @@
  8         vocalized          search            enable vocalization of aya text               "True"           True | False
  9         recitation         search            recitation id                                 "1"              1 to 30
  10        translation        search            translation id                                "None"           \*
+ 11        romanization       search            type of romanization                          "none"           none | buckwalter | iso | arabtex
  11        view               search            pre-defined configuration for view            "custom"         minimal | normal | full | statistic | linguistic | custom
  12        prev_aya           search            enable previous aya retrieving                "False"          True | False
  13        next_aya           search            enable next aya retrieving                    "False"          True | False