changeset 821:ea1fc283b742

fixup xapwrap for capitalized prefixed words
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Sat, 10 Jun 2006 11:28:27 +0200
parents c0b243a72744
children 47a674c70966
files MoinMoin/support/xapwrap/document.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/support/xapwrap/document.py	Sat Jun 10 10:53:18 2006 +0200
+++ b/MoinMoin/support/xapwrap/document.py	Sat Jun 10 11:28:27 2006 +0200
@@ -1,6 +1,7 @@
 """
     xapwrap.document - Pythonic wrapper around Xapian's Document API
 """
+import string
 import datetime
 import re
 import cPickle
@@ -296,7 +297,7 @@
     else: # we have a map, so first translate it using the map (e.g. 'title' -> 'S')
         prefix = prefixMap.get(prefix, prefix.upper())
 
-    result = prefix + token
+    result = '%s%s%s' % (prefix, token[0] in string.uppercase and ':' or '', token)
     # since return value is going into the db, it must be encoded as UTF-8
     result = result.encode(UNICODE_ENCODING, UNICODE_ERROR_POLICY)
     return checkKeyLen(result)