Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: is not working with special character #26

Closed
jirikuncar opened this issue Jul 26, 2015 · 1 comment
Closed

parser: is not working with special character #26

jirikuncar opened this issue Jul 26, 2015 · 1 comment
Assignees
Milestone

Comments

@jirikuncar
Copy link
Member

It is impossible to do search with special character like in "Gård"

Some pointers for the resolution:

In [9]: from invenio.modules.search.api import parser

In [13]: import pypeg2

In [14]: pypeg2.parse("toto", parser(), whitespace="")
Out[14]: Main(Query([SimpleQuery(ValueQuery(Value(SimpleValue('toto'))))]))

In [15]: pypeg2.parse("Gård", parser(), whitespace="")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-15-64494a74f7c6> in <module>()
----> 1 pypeg2.parse("Gård", parser(), whitespace="") ...

In [16]: from __future__ import unicode_literals, print_function

In [17]: pypeg2.parse("Gård", parser(), whitespace="")
Out[17]: Main(Query([SimpleQuery(ValueQuery(Value(SimpleValue(u'G\xe5rd'))))]))

From the pypeg documentation :

Caveat: pyPEG 2.x is written for Python 3. You can use it with Python 2.7 with the following import (you don't need that for Python 3):

from __future__ import unicode_literals, print_function

originally submitted by @PXke as inveniosoftware/invenio#3296

@jirikuncar jirikuncar added this to the v0.2.1 milestone Jul 26, 2015
@jirikuncar jirikuncar self-assigned this Jul 26, 2015
@jirikuncar
Copy link
Member Author

Closed via inveniosoftware/invenio@4a3c7c7.

@jirikuncar jirikuncar modified the milestones: v0.2.1, v0.3.0 Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant