GithubHelp home page GithubHelp logo

rsennrich / parzu Goto Github PK

View Code? Open in Web Editor NEW
78.0 78.0 20.0 4.76 MB

The Zurich Dependency Parser for German

Home Page: https://pub.cl.uzh.ch/demo/parzu/

License: GNU General Public License v2.0

Perl 0.15% Prolog 91.91% Python 7.92% Shell 0.03% Dockerfile 0.01%

parzu's People

Contributors

lukovnikov avatar nakami avatar pagelj avatar rsennrich avatar simon-clematide avatar vanatteveldt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parzu's Issues

Prevent parzu crashes

I am trying to parse our training data, and unfortunately every now and then, an error breaks the parsing.

[Thread 1] pl-fli.c:2428: codeToAtom: Assertion failed: chrcode >= 0
Parser process 7070 has crashed on sentence 299. If you don't see swipl error message, try parsing sentence in single-processed mode

First of all, the parser is probably reporting a wrong sentence id, because the output file only has less sentences than 299. Using --process 1 does not prevent the error from occuring.

I am not really interested for the particular sentence causing the error, but I would appreciate it if the parser can go on with the next sentence of the given file, instead of crashing.

"Cannot open transducer file" unless a tagged file is supplied

Hello, I'm on Yosemite. I installed everything and downloaded the latest model files. When I run ./parzu I get this error:

$ echo "Das ist ein Test." | ./parzu
Starting tokenizer
Starting POS-tagger
Starting preprocessor
* Load model
Tokenizer v3
Language: de

Error: Cannot open transducer file ../zmorge-20150315-smor_newlemma.ca

* Label sequences
* Done
reading transducer from file "external/zmorge-20150315-smor_newlemma.ca"...
finished.

Starting parser
Starting postprocessor

But if I use a tagged file, it works fine:

$ ./parzu -i tagged < external/clevertagger/sample_training_file.txt
Starting preprocessor
reading transducer from file "external/zmorge-20140521-smor_newlemma.ca"...
finished.

Starting parser
Starting postprocessor
1   Und und KON KON _   0   root    _   _ 
(usw...)

/external/clevertagger/ contains clevertagger (folder), hdt_ab.zmorge-20140521-smor_newlemma.model and zmorge-20150315-smor_newlemma.ca.

in clevertagger/config.py, I have set SMOR_MODEL = '../zmorge-20140521-smor_newlemma.ca'.

in ParZu's config.ini, I have set smor_model = external/zmorge-20150315-smor_newlemma.ca.

Now, if you look at the error message above, you would think that it's the path in the clevertagger config.py causing the problem. But I can run clevertagger successfully on its own. So why can't ParZu seem to load clevertagger? Thanks for your help.

Run SWI-prolog from custom location

Hi again,

since the pre-installed version of swi-prolog is old, and our administrators are not willing to upgrade it with custom ways, I tried to compile version swi-prolog 7.1.27 myself. Unfortunately, although swi-prolog compiled fine, I cannot find which is the proper way to make parZu run with it.

In particular, I tried two ways:
(a) modify parzu.py lines 25 and 30, in order to point to the exact location of swipl, e.g. /project/folder/software/swipl/swip . After this, parsing only gave me empty output.
(b) modify $PATH variable of the system, so that 'swipl' command looks on the freshly compiled folder instead of /usr/bin/swipl (old version). This gives an error [FATAL ERROR: Could not find system resources] which I am unable to fix, although I set $SWI_HOME_DIR both from commandline and inside the python script

could you please advise on how to proceed?
cheers
Lefteris

Some texts take very long to parse

I am using parzu to get features for documents that I first process with Spacy. For this reason, I am sending pre-tokenized input to Parzu. I noticed that some documents, even if the document or the longest sentence is not very big, need very long to parse.

Here is an example text, already preprocessed/tokenized, url-encoded and added as a parameter to the complete URL to process it:

http://localhost:5003/parse/?inputformat=tokenized&text=F%C3%BCr%0AEin-%0Aund%0AUmsteiger%0A%3C%0Atable%0Awidth%3D%2275%0A%25%0A%22%0Aborder%3D%220%0A%22%0A%3E%0A%3C%0Atr%0Abgcolor%3D%22%23000000%0A%22%0A%3E%0A%3C%0Atd%3E%3Cfont%0Acolor%3D%22%23FFFFFF%0A%22%0Asize%3D%222%0A%22%0Aface%3D%22Arial%0A%2C%0AHelvetica%0A%2C%0Asans-serif%22%3EEin%0ALeitfaden%0Adurch%0Aden%0ALinux-Dschungel%0A%3C%0A/font%3E%3C/td%0A%3E%0A%3C%0A/tr%0A%3E%0A%3C%0A/table%0A%3E%0ATOP-SITES%0Af%0Af%0Ahttp%3A//www.cs.Helsinki.FI/~torvalds/%0AOffizielle%0AHomepage%0Avon%0ALinus%0ATorvalds%0Ahttp%3A//www.zdnet.de/linux/%0AZDNet-Special%0Ahttp%3A//www.linux.com/%0ALinx.com%0A-%0ADie%0ALinux-Site%0Aim%0ANetz%0Ahttp%3A//www.heise.de/ix/linux/%0ADie%0ALinux-Seiten%0Ader%0AZeitschrift-IX%0Ahttp%3A//www.linux.de/%0ALinks%0A%2C%0ANews%0A%2C%0A....%0Ahttp%3A//www.it-nachrichten.de/news/98742119/html/t/links/index.html%0AUmfangreiche%0ALinkseite%0Ahttp%3A//li.luga.or.at/%0ALinux-International%0Ahttp%3A//www.linux.org/%0ALinux-User-Site%0Ahttp%3A//www.linux.at/%0ALinux%0Ain%0A%C3%96sterreich%0AKURSE%0Af%0Af%0Ahttp%3A//tux.isCool.net%0ALinux%0AAnf%C3%A4nger%0AForum%0Ahttp%3A//www.pro-linux.de/%0ANews%0Aund%0AWorksshops%0Ahttp%3A//linux-forum.notrix.de%0ALinux%0AForum%0Ahttp%3A//public.surfree.com/rimez/master.html%0AThe%0ALinux%0ANewbie%0Ahttp%3A//www.rennkuckuck.de/linux/%0ALinux-Einf%C3%BChrung%0A-%0AUmfangreiche%0AEinf%C3%BChrung%0Aund%0ANachschlagewerk%0Ahttp%3A//user.cs.tu-berlin.de/~milenium/index.html%0AN%C3%BCtzliches%0Af%C3%BCr%0AEinsteiger%0Ahttp%3A//www.guug.de/~winni/linux/%0ACrash-Kurs%0Ahttp%3A//www.zfescht.ch/pages/info/linux/linux.htm%0AWichtige%0ALinux-Befehle%0ASOFTWARE%0Af%0Af%0Ahttp%3A//univie.linuxberg.com/%0ALinuxberg%0A-%0ABei%0AWindows-UserInnen%0Aals%0ATUCOWS%0Abekannt%0Aftp.tuwien.ac.at/linux/%0AFTP-Server%0ATU-Wien%0ABENUTZEROBERFL%C3%84CHEN%0Af%0Af%0Ahttp%3A//www.kde.org%0AK%0ADesktop%0AEnvironment%0Ahttp%3A//www.gnome.org%0AGNOME%0AProject

At this moment, the parzu demo servers is not usable (I am getting a 504 gateway time-out) so I could not test this data there, but one it works again it should be testable using:

https://pub.cl.uzh.ch/demo/parzu/parse/?inputformat=tokenized&text=F%C3%BCr%0AEin-%0Aund%0AUmsteiger%0A%3C%0Atable%0Awidth%3D%2275%0A%25%0A%22%0Aborder%3D%220%0A%22%0A%3E%0A%3C%0Atr%0Abgcolor%3D%22%23000000%0A%22%0A%3E%0A%3C%0Atd%3E%3Cfont%0Acolor%3D%22%23FFFFFF%0A%22%0Asize%3D%222%0A%22%0Aface%3D%22Arial%0A%2C%0AHelvetica%0A%2C%0Asans-serif%22%3EEin%0ALeitfaden%0Adurch%0Aden%0ALinux-Dschungel%0A%3C%0A/font%3E%3C/td%0A%3E%0A%3C%0A/tr%0A%3E%0A%3C%0A/table%0A%3E%0ATOP-SITES%0Af%0Af%0Ahttp%3A//www.cs.Helsinki.FI/~torvalds/%0AOffizielle%0AHomepage%0Avon%0ALinus%0ATorvalds%0Ahttp%3A//www.zdnet.de/linux/%0AZDNet-Special%0Ahttp%3A//www.linux.com/%0ALinx.com%0A-%0ADie%0ALinux-Site%0Aim%0ANetz%0Ahttp%3A//www.heise.de/ix/linux/%0ADie%0ALinux-Seiten%0Ader%0AZeitschrift-IX%0Ahttp%3A//www.linux.de/%0ALinks%0A%2C%0ANews%0A%2C%0A....%0Ahttp%3A//www.it-nachrichten.de/news/98742119/html/t/links/index.html%0AUmfangreiche%0ALinkseite%0Ahttp%3A//li.luga.or.at/%0ALinux-International%0Ahttp%3A//www.linux.org/%0ALinux-User-Site%0Ahttp%3A//www.linux.at/%0ALinux%0Ain%0A%C3%96sterreich%0AKURSE%0Af%0Af%0Ahttp%3A//tux.isCool.net%0ALinux%0AAnf%C3%A4nger%0AForum%0Ahttp%3A//www.pro-linux.de/%0ANews%0Aund%0AWorksshops%0Ahttp%3A//linux-forum.notrix.de%0ALinux%0AForum%0Ahttp%3A//public.surfree.com/rimez/master.html%0AThe%0ALinux%0ANewbie%0Ahttp%3A//www.rennkuckuck.de/linux/%0ALinux-Einf%C3%BChrung%0A-%0AUmfangreiche%0AEinf%C3%BChrung%0Aund%0ANachschlagewerk%0Ahttp%3A//user.cs.tu-berlin.de/~milenium/index.html%0AN%C3%BCtzliches%0Af%C3%BCr%0AEinsteiger%0Ahttp%3A//www.guug.de/~winni/linux/%0ACrash-Kurs%0Ahttp%3A//www.zfescht.ch/pages/info/linux/linux.htm%0AWichtige%0ALinux-Befehle%0ASOFTWARE%0Af%0Af%0Ahttp%3A//univie.linuxberg.com/%0ALinuxberg%0A-%0ABei%0AWindows-UserInnen%0Aals%0ATUCOWS%0Abekannt%0Aftp.tuwien.ac.at/linux/%0AFTP-Server%0ATU-Wien%0ABENUTZEROBERFL%C3%84CHEN%0Af%0Af%0Ahttp%3A//www.kde.org%0AK%0ADesktop%0AEnvironment%0Ahttp%3A//www.gnome.org%0AGNOME%0AProject

ImportError: No module named pexpect when starting docker run

Hi Rico,

I tried to run parzu from docker.

OS: Win10

Steps for reproducing:

$ docker pull rsennrich/parzu
OK

$ echo "Ich bin ein Berliner." | docker run -i rsennrich/parzu
Starting tokenizer
Starting POS-tagger
Starting preprocessor
Traceback (most recent call last):
File "/ParZu/external/clevertagger/clevertagger", line 14, in
import pexpect
ImportError: No module named pexpect
Tokenizer v3
Language: de
reading transducer from file "/ParZu/external/zmorge-20150315-smor_newlemma.ca"...
finished.

Starting parser
Starting postprocessor

$ docker version
Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:51 2018
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:55:00 2018
OS/Arch: linux/amd64
Experimental: false

Any idea how to fix it?`

Thank you in advance.

Regards
Giovanni

Timeout values cannot be configured

The timeout values for reading from the swipl processes is hard-coded to 10 seconds in parzu_class.py. I found a large number of cases where this was not enough.

It would be very helpful if these values could get changed via the options map that gets passed to the Parser.__init__ method.

Difference Local and WebVersion results

Hello together,

I tried some sentences with my local Parzu-Version ( TüBa Statistics included ).
The results are different to the Parzu Service on the WebPage.
Do you know the reason for that?

Thanks in advance.

Sierra issue

Hello, I am with macOS Sierra and I already followed the instructions by tabidots:
#4

That means:

  • I edited the install.sh: "sed -i" to "sed -e"
  • after that the install.sh runs but the path to ".../ParZu/external/zmorge-20140521-smor_newlemma.ca" isn't touched in the config.ini and external/clevertagger/config.py, so I changed it manually

But still, I get this error message:

Starting tokenizer
Starting POS-tagger
Starting preprocessor
* Load model
error: cannot open input model file
	<No such file or directory>
Tokenizer v3
Language: de
reading transducer from file "/Users/lumilton/ParZu/external/zmorge-20140521-smor_newlemma.ca"...
finished.

close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr

Do you have any idea how I could fix this? What is the input model file?

Thank you!
Luke

Executing "create_statistics.sh"

Hello together,

I have the Tüba-D/Z corpus in the right format ( CONLL, UTF-8 ).
When I run create_statistics.sh on the Tüba File CONLL2006 I get:
"Illegal UTF-8 continuation" error.
If I run CONLL2011 there is another message saying:
''/1: Undefined procedure: w/7
Exception: (11) w(_4114, _4120, _4148, ne, _4152, _4126, _4132) ?

Thanks for your help in advance.

sfst library isn't available anymore

I tried to setup ParZu but I didn't find the required sfst library anywhere (the ftp server seems to be down). Can you provide me a working download link or do you have any solution to work without this library?

Problem with subprocess.py

Hello,
i am trying to use ParZu. but if i try to make test-use, then i get errors.
Terminal-Output:
"anonym@ubuntu:/MODULE/ParZu$ echo "Das ist ein Test." | ./parzu
Starting tokenizer
Starting POS-tagger
Traceback (most recent call last):
File "./parzu", line 420, in
main(options)
File "./parzu", line 241, in main
last_step = func(instream,outstream,options)
File "./parzu", line 276, in tag
tagger_formatted = Popen(options['taggercmd'], stdin=instream, stdout=outstream, stderr=options['senderror'])
File "/usr/lib/python2.7/subprocess.py", line 679, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1239, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
anonym@ubuntu:
/MODULE/ParZu$ Tokenizer v3
Language: de
^C"
i am pretty sure, that my config-file is right.

Parse multiple files without reloading models etc.

Is there a proper way to process multiple files without reinitialising the parser again and again? I need it to parse over 4k files to annotate a training set but this would take by far to long if I just use the command again and again for each file (~11h). I could just stick them togther and split them afterwards but thats kinda "dirty".

Error POS Tatting PPOSAT

Hi @rsennrich

Using the sentence: "Das ist diese alte Tochter jener Frau und ihres hübschen Mannes" resulting a dependency between "und" (KON) and "ihres" (PPOSAT). Not correct so far I think ?

PPOSAT depends zu NN ("Mannes"), isn´t it?

thnx!
Florian

Wrong Tagging for APZR

Hi @rsennrich,

we're playing around with ParZu, which is really fun and awesome work.

But we find a small but important differnce between the output of your docker image and your online tool https://pub.cl.uzh.ch/demo/parzu/.

sentence: Eigentlich ist der von Geburt an perfekte Mann in der Lage, alles zu machen.

failure

  1. is the output of your online tool
  2. is the docker image output

Could you image how this difference could appear. Doesn't github has the current version?

Thank you for your feedback

Cannot use the module

Hi, i am really sorry if this issue is trivial, but I cannot seem to make this work.

I extracted the module in my python37/Lib/site-package folder and tried to run the provided lines

import parzu_class as parzu #line1
options = parzu.process_arguments() #line2
ParZu = parzu.Parser(options) #line3
sentences = ParZu.main('Das ist ein Test. Das auch.') #line4
for sentence in sentences: #line5
print sentence #line6

I had to change line 1 in "import parzu" because otherwise it would not find the module and line 6 which is missing the () for the print function.

I however still get the following error:

"module 'parzu' has no attribute 'process_arguments'"

Do you have any sugestion?

I am using python on Windows 10, x64

Feature: Allow additional annotations for input sentences

Hi 👋,

this is a feature request for an additional input format that also tackles the output format. I often have additional annotations like a document id or a sentence id for given sentences and I want to preserve the annotations in the parses.

An input could look like this:

documentId sentenceId sentence
0 0 first sentence, first document
0 1 second sentence, first document
1 0 first sentence, second document

For the output, I propose an one sentence per line format since this is easy to post process.

0 1 Der Arzt arbeitet im Krankenhaus . Der@@Art@@der@@def|Masc|Nom|Sg Arzt@@nn@@arzt@@masc|Nom|Sg arbeitet@@VVFIN@@arbeiten@@3|Sg|Pres|Ind im@@APPRART@@in@@dat Krankenhaus@@nn@@Krankenhaus@@neut|Dat|Sg .@@$.@@--@@_ DET(arzt-1,der-0) SUBJ(arbeiten-2,arzt-1) S(arbeiten-2,arbeiten-2) PP(arbeiten-2,in-3) PN(in-3,krankenhaus-4) ROOT(-5,-5)

I already tried to re-add the annotations after the parsing myself. However, this solution doesn't work since ParZu computes in a multi-threaded manner and doesn't preserve the input order in its output.

To overcome this issue, one could introduce some sort of buffer that stores finished sentences after parsing. In order to preserve the input order the buffer could flush sentences in the correct order once a sequence is computed. Do you see the problem when the output parses don't match the input?

Creating the visual dependency graph from conll data

Hello,
the parser works great and I would like to reproduce the dependency graph
that I saw in your example.
image

I am using the docker image and tried the option "conll" and "graphical" as an output.
"graphical" seems to include the svg file but I would like to understand how to find the hierarchical arrows between the different words based on the "conll" data (not just the final image, but in some kind of hierarchical structure.)

Unexpected keyword argument 'text' for Python3.1

Running parzu_server.py with python3.1 I get the following error.

2022-04-20T08:32:54.677401533Z   File "parzu_server.py", line 64, in __init__
2022-04-20T08:32:54.677406805Z     self.parser = Parser(options, timeout=timeout)
2022-04-20T08:32:54.677411401Z   File "/ParZu/parzu_class.py", line 261, in __init__
2022-04-20T08:32:54.677416572Z     swipl_version, _ = Popen(['swipl', '--version'], stdout=PIPE, text=True).communicate()
2022-04-20T08:32:54.677423357Z TypeError: __init__() got an unexpected keyword argument 'text'
2022-04-20T08:32:55.025972638Z     self.prolog_preprocess.close()
2022-04-20T08:32:55.026000012Z AttributeError: 'Parser' object has no attribute 'prolog_preprocess'

I believe this to be related to https://stackoverflow.com/questions/52663518/python-subprocess-popen-doesnt-take-text-argument

To run the code, I used the following Dockerfile


RUN apt-get update && apt-get -y install software-properties-common && add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
    git \
    swi-prolog \
    sfst \
    unzip \
    wget \
    python3.1 \
    python3-pexpect \
    python3-flask

ADD https://api.github.com/repos/rsennrich/ParZu/git/refs/heads/master version.json
RUN git clone https://github.com/rsennrich/ParZu

RUN (cd ParZu; bash install.sh)

RUN apt-get update && apt-get -y install curl

EXPOSE 5003

WORKDIR /ParZu
CMD python3 parzu_server.py --host 0.0.0.0

To circumvent this error, I also tried using python3.7. However, this causes the server to respond with an empty list on the first request, with subsequent requests working fine.

This can be reproduced with the following Dockerfile


RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
    git \
    swi-prolog \
    sfst \
    unzip \
    wget \
    python3.1 \
    python3-pexpect \
    python3-flask

ADD https://api.github.com/repos/rsennrich/ParZu/git/refs/heads/master version.json
RUN git clone https://github.com/rsennrich/ParZu

RUN (cd ParZu; bash install.sh)

RUN apt-get update && apt-get -y install curl

EXPOSE 5003

WORKDIR /ParZu
CMD python3 parzu_server.py --host 0.0.0.0

Thank you for your help!

swi-prolog sfst

I cannot use sudo apt-get to download swi-prolog sfst. The other alternative is to clone the swi-prolog repo and build it. Does anyone have any other solution?

Cannot parse file in docker

Hello Rico,
i have a naive question. How can I parse file in docker (windows 10)? I tried the following command line but it leads to error.
c:\user> docker run -i rsennrich/parzu python parzu.py -i tagged < sample_input
Then I got an error:

In Zeile:1 Zeichen:54

  • docker run rsennrich/parzu python parzu.py -i tagged < sample_input
  •                                                  ~
    

Der Operator "<" ist für zukünftige Versionen reserviert.

  • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : RedirectionNotSupported

Could you please tell me how to user it in the right way? Thanks a lot in advance!
Best, Tinghui

Problem running the create_statistics.sh script

It is not possible for me to run ./statistics/create_statistics.sh conllfile because then the prolog files are not found.

So I cd into statistics and run ./create_statistics.sh ../conllfile

The first problem is in stats_creator/conll2prolog.py line 70 which uses a python 2 print statement which will not work with Python 3. This can be fixed by changing the line into

print("w({0}, {1}, '{2}', '{3}', '{4}', {5}, {6}).".format(i,pos,token,tag,label,head,morph))

for Python 3.

The second problem is that there is no guard for conll input lines which do not have at
least 11 fields. partA of my converted hamburg dependency treebank has only 10 fields in
line 1378186 so the python program crashes there. This can be fixed by replacing the line
with the split function by:

    fields = line.strip().split()
    if len(fields) < 11:
        print("Line {} has only {} fields, ignored".format(linenr, len(fields)), file=sys.stderr)
        continue
    pos, word, lemma, _, tag, _, morph, _, head, _, label = fields[:11]

(and also adding the linenr counter).

Support --tokenized or --tokenized_lines in the REST API

It would be very cool if the server would support processing already tokenised text. For get, a parameter could indicate that the string is whitespace-separated tokens, and for POST requests with JSON, an array of tokens could get passed ass well.

So ideally this would just be another REST parameter in addition to text and format, maybe "input" with possible values "tokenized" and "tokenized_lines" and maybe also "plain", "preprocessed" and "tagged" to support everything the class actually supports.

Error 502 with the demo of the ParZu

The page of the ParZu shows the Error 502. Is there any server problem or has the demo been closed?
I need it for an study work at the University of Bonn.
Best regards
Lazarus971

pexpect error on init

Running your test code

import parzu_class as parzu
options = parzu.process_arguments()
options['verbose']      = False
options['linewise']     = True
options['morphology']   = 'smor'
options['outputformat'] = 'prolog'
ParZu = parzu.Parser(options)

sentences = ParZu.main('Das ist ein Test. Das auch.')
for sentence in sentences:
    print(sentence)`

i get the following error.

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 111, in expect_loop
    incoming = spawn.read_nonblocking(spawn.maxread, timeout)
  File "/usr/local/lib/python3.8/site-packages/pexpect/pty_spawn.py", line 486, in read_nonblocking
    return super(spawn, self).read_nonblocking(size)
  File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 176, in read_nonblocking
    raise EOF('End Of File (EOF). Empty string style platform.')
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "skripte.py", line 9, in <module>
    ParZu = parzu.Parser(options)
  File "/Users/xxx/Sites/generator_dashboard/app/parzu/parzu_class.py", line 278, in __init__
    self.prolog_parser.expect_exact('?- ')
  File "/usr/local/lib/python3.8/site-packages/pexpect/spawnbase.py", line 418, in expect_exact
    return exp.expect_loop(timeout)
  File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 117, in expect_loop
    return self.eof(e)
  File "/usr/local/lib/python3.8/site-packages/pexpect/expect.py", line 63, in eof
    raise EOF(msg)
pexpect.exceptions.EOF: End Of File (EOF). Empty string style platform.
<pexpect.pty_spawn.spawn object at 0x1017665b0>
command: /usr/local/bin/swipl
args: [b'/usr/local/bin/swipl', b'-q', b'-s', b'ParZu-parser.pl', b'-G248M', b'-L248M']
buffer (last 100 chars): ''
before (last 100 chars): ", --name, --no-name or --noname.\r\nBoth '-' or '_' are accepted as word-separator for long options.\r\n"
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 23996
child_fd: 10
closed: False
timeout: 100
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_string:
    0: '?- '

I use swipl 8.2.1 and pexpect 4.6.0 on a mac.

Do you have any idea?

Using the python module

Hello,

i am trying to use Parzu from my python programm. Unfortunately I cannot find an explanation how to use the python module. How does the method call look like? Is there anything special to do.
Thanks in advance.

For python scripts to be invoked from command line, consider #!/usr/bin/env python

Currently the scripts, like parzu_server.py or parzy.py use the shebang line
#!/usr/bin/python which will always invoke the system-installed python command (which depending on the system may be Python 2 or 3).
However, many users have a per-user python command e.g. to make "python" default to python3 instead of Python 2 or they their own Anaconda installation within their user space where all the python packages are installed and new ones can be installed without administrator access.

Using #!/usr/bin/env python would make use of those per-user python commands but would still use the default /usr/bin/python if no per-user python command exists (essentially just uses what is in the PATH).

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.