# HG changeset patch # User abukhman # Date 1282642725 -7200 # Node ID 4f4fe4e56ffe6a20eb055c9388cdd28fb3184d4d # Parent de82ae2e9850d7e56e0402430645cdc4262475ec characterNormalization diff -r de82ae2e9850 -r 4f4fe4e56ffe MpdlXmlTextServer.py --- a/MpdlXmlTextServer.py Tue Aug 24 11:33:26 2010 +0200 +++ b/MpdlXmlTextServer.py Tue Aug 24 11:38:45 2010 +0200 @@ -52,7 +52,7 @@ queryType =pageinfo['queryType'] viewMode= pageinfo['viewMode'] tocMode = pageinfo['tocMode'] - #characterNormalization = pageinfo ['characterNormalization'] + characterNormalization = pageinfo ['characterNormalization'] tocPN = pageinfo['tocPN'] selfurl = self.absolute_url() @@ -72,9 +72,7 @@ href = hrefNode.nodeValue if href.startswith('page-fragment.xql'): selfurl = self.absolute_url() - #pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&characterNormalization=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN,characterNormalization)) - pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN)) - + pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&characterNormalization=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN,characterNormalization)) hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) return serializeNode(pagenode) if (queryType=="fulltextMorph"): @@ -88,9 +86,7 @@ href = hrefNode.nodeValue if href.startswith('page-fragment.xql'): selfurl = self.absolute_url() - #pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&characterNormalization=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN,characterNormalization)) - pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN)) - + pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&characterNormalization=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN,characterNormalization)) hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) if href.startswith('../lt/lemma.xql'): hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma_New'%(selfurl)) @@ -108,8 +104,7 @@ hrefNode = l.getAttributeNodeNS(None, u"href") if hrefNode: href = hrefNode.nodeValue - #hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s&characterNormalization=%s'%(viewMode,tocMode,tocPN,pn,characterNormalization)) - hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s'%(viewMode,tocMode,tocPN,pn)) + hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s&characterNormalization=%s'%(viewMode,tocMode,tocPN,pn,characterNormalization)) if href.startswith('../lt/lex.xql'): hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_voc'%selfurl) l.setAttributeNS(None, 'target', '_blank') @@ -135,21 +130,21 @@ docinfo['numPages'] = text.count("