Exemplo n.º 1
0
 def spellcheck(self, REQUEST):
     from Products.kupu.python.spellcheck import SpellChecker, format_result
     data = REQUEST["text"]
     c = SpellChecker()
     result = c.check(data)
     if result == None:
         result = ""
     else:
         result = format_result(result)
     REQUEST.RESPONSE.setHeader("Content-Type","text/xml, charset=utf-8")
     REQUEST.RESPONSE.setHeader("Content-Length",str(len(result)))
     return result
Exemplo n.º 2
0
    def spellcheck(self, REQUEST, RESPONSE):
        """Spellchecker button support fucntion"""
        data = REQUEST.form.get('text')
        c = SpellChecker()
        result = c.check(data)
        if result == None:
            result = ''
        else:
            result = format_result(result)

        RESPONSE.setHeader('Content-Type', 'text/xml,charset=UTF-8')
        RESPONSE.setHeader('Content-Length', len(result))
        RESPONSE.write(result)
Exemplo n.º 3
0
 def spellcheck(self, REQUEST):
     """Call spellchecker: WARNING this functionality may not work,
     it is not part of the standard Plone+kupu implementation.
     Some user assembly required."""
     from Products.kupu.python.spellcheck import SpellChecker, format_result
     data = REQUEST["text"]
     c = SpellChecker()
     result = c.check(data)
     if result == None:
         result = ""
     else:
         result = format_result(result)
     REQUEST.RESPONSE.setHeader("Content-Type","text/xml, charset=utf-8")
     REQUEST.RESPONSE.setHeader("Content-Length",str(len(result)))
     return result
Exemplo n.º 4
0
 def spellcheck(self, REQUEST):
     """Call spellchecker: WARNING this functionality may not work,
     it is not part of the standard Plone+kupu implementation.
     Some user assembly required."""
     from Products.kupu.python.spellcheck import SpellChecker, format_result
     data = REQUEST["text"]
     c = SpellChecker()
     result = c.check(data)
     if result == None:
         result = ""
     else:
         result = format_result(result)
     REQUEST.RESPONSE.setHeader("Content-Type", "text/xml, charset=utf-8")
     REQUEST.RESPONSE.setHeader("Content-Length", str(len(result)))
     return result