Giter Site home page Giter Site logo

pysimplenlg's People

Contributors

bjascob 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

Watchers

 avatar  avatar  avatar

pysimplenlg's Issues

Tutorial test does not work. Missing files in the module

I installed the simplenlg module locally and ran your tutorial test file. Got this error.

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

================ RESTART: C:\Users\jb00557372\Desktop\test.py ================
EEEEEEEEEEEE

ERROR: testSection10 (main.TutorialTest)

Traceback (most recent call last):
File "C:\Users\jb00557372\Desktop\test.py", line 234, in testSection10
lexicon = Lexicon.getDefaultLexicon() # default simplenlg lexicon
File "C:\Users\jb00557372\AppData\Local\Programs\Python\Python37-32\lib\site-packages\simplenlg\lexicon\Lexicon.py", line 33, in getDefaultLexicon
return XMLLexicon()
File "C:\Users\jb00557372\AppData\Local\Programs\Python\Python37-32\lib\site-packages\simplenlg\lexicon\XMLLexicon.py", line 46, in init
self.createLexicon(lexicon_fn)
File "C:\Users\jb00557372\AppData\Local\Programs\Python\Python37-32\lib\site-packages\simplenlg\lexicon\XMLLexicon.py", line 52, in createLexicon
tree = ET.parse(xmlfile)
File "C:\Users\jb00557372\AppData\Local\Programs\Python\Python37-32\lib\xml\etree\ElementTree.py", line 1197, in parse
tree.parse(source, parser)
File "C:\Users\jb00557372\AppData\Local\Programs\Python\Python37-32\lib\xml\etree\ElementTree.py", line 587, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\jb00557372\AppData\Local\Programs\Python\Python37-32\lib\site-packages\simplenlg\resources\default-lexicon.xml'

no verb realization

I tried some basic example with pySimplNLG. However, verbs are systematically omitted from the final output.

I used the following code:

`import simplenlg as nlg

nlg_factory = nlg.NLGFactory()
lexicon = nlg.lexicon.Lexicon()
realiser = nlg.realiser.Realiser(lexicon)

p = nlg_factory.createClause()
p.setSubject("The dog")
p.setVerb("bite")
p.setObject("the monkey")
p.setFeature(nlg.Feature.TENSE,nlg.Tense.PAST)
print(realiser.realiseSentence(p))`

which only produces

The dog the monkey.

Just to make sure, I also checked the original JAVA-code from which this package has been built.
That code does create proper sentences with verbs. So I guess there must be a bug in the python version.

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.