Giter Site home page Giter Site logo

alpinocorpus-python's People

Contributors

andreasvc avatar danieldk avatar jelmervdl avatar pebbe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

andreasvc

alpinocorpus-python's Issues

unicode in queries

server.py kan niet omgaan met unicode-tekens in een query. Hier is een patch:

--- ../alpinocorpus-python/examples/server.py   2012-02-02 18:19:46.000000000 +0100
+++ server.py   2012-02-02 20:05:05.000000000 +0100
@@ -63,7 +63,7 @@
       params = web.input()
       contents = False
       if params.has_key('query'):
-        gen = c.query(params['query'])
+        gen = c.query(params['query'].encode('utf-8'))
         if params.has_key('contents') and params.get('contents') == '1':
           contents = True
       else:
@@ -92,7 +92,7 @@

       # Do we want to highlight something?
       if params.has_key('markerQuery') and params.has_key('markerAttr') and params.has_key('markerValue'):
-        markerQueries = [alpinocorpus.MarkerQuery(params['markerQuery'],
+        markerQueries = [alpinocorpus.MarkerQuery(params['markerQuery'].encode('utf-8'),
           params['markerAttr'], params['markerValue'])]
       else:
         markerQueries = []
@@ -101,7 +101,7 @@

       # Was a query provided?
       if params.has_key('query'):
-        gen = c.queryWithStylesheet(params['query'], web.data(), markerQueries)
+        gen = c.queryWithStylesheet(params['query'].encode('utf-8'), web.data(), markerQueries)
       else:
         gen = c.entriesWithStylesheet(web.data(), markerQueries)

@@ -125,7 +125,7 @@

       # Was there a request to mark entries?
       if params.has_key('markerQuery') and params.has_key('markerAttr') and params.has_key('markerValue'):
-        queries = [alpinocorpus.MarkerQuery(params['markerQuery'],
+        queries = [alpinocorpus.MarkerQuery(params['markerQuery'].encode('utf-8'),
           params['markerAttr'], params['markerValue'])]
         data = c.readMarkQueries(entry, queries)
       else:
@@ -149,7 +149,7 @@

       # Was there a request to mark entries?
       if params.has_key('query'):
-        query = params.get('query')
+        query = params.get('query').encode('utf-8')
         if c.validQuery(query):
           return '1'
         else:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.