changeset 164:530f6983f72d

characterNormalization
author abukhman
date Tue, 24 Aug 2010 14:06:02 +0200
parents 06bb2a289068
children 820a2a4b23c3
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Tue Aug 24 13:49:23 2010 +0200
+++ b/MpdlXmlTextServer.py	Tue Aug 24 14:06:02 2010 +0200
@@ -137,7 +137,7 @@
         url = docinfo['url']
         viewMode= pageinfo['viewMode']
         tocMode = pageinfo['tocMode']
-        #characterNormalization = pageinfo ['characterNormalization']
+        characterNormalization=pageinfo['characterNormalization']
         tocPN = pageinfo['tocPN']
         selfurl = self.absolute_url()   
         if mode == "text_dict":
@@ -165,7 +165,7 @@
                     if hrefNode:
                         href= hrefNode.nodeValue
                         if href.startswith('#note-'):
-                            hrefNode.nodeValue = href.replace('#note-',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s#note-"%(url,viewMode,tocMode,tocPN,pn))
+                            hrefNode.nodeValue = href.replace('#note-',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s&characterNormalization=%s#note-"%(url,viewMode,tocMode,tocPN,pn,characterNormalization))
                 return serializeNode(pagenode)
         if mode == "xml":
               # first div contains text
@@ -307,7 +307,7 @@
         tocPN = pageinfo['tocPN']  
         
         data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath,queryType, pagesize, pn))  
-        page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s'%(selfurl,url, viewMode, tocMode, tocPN))
+        page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&characterNormalization=%s'%(selfurl,url, viewMode, tocMode, tocPN,characterNormalization))
         text = page.replace('mode=image','mode=texttool')
         #logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
         #logging.debug("documentViewer (characterNormalization) text: %s"%(text))
--- a/documentViewer.py	Tue Aug 24 13:49:23 2010 +0200
+++ b/documentViewer.py	Tue Aug 24 14:06:02 2010 +0200
@@ -701,7 +701,7 @@
                 pageinfo['numgroups'] += 1        
         pageinfo['viewMode'] = viewMode
         pageinfo['tocMode'] = tocMode
-        pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','')
+        pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','reg')
         pageinfo['query'] = self.REQUEST.get('query',' ')
         pageinfo['queryType'] = self.REQUEST.get('queryType',' ')
         pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext')