Git Product home page Git Product logo

Comments (6)

pjwerneck avatar pjwerneck commented on July 17, 2024

@ddugovic You can probably replace the whole ctypes+libtesseract dance with pytesseract. Have you tried that?

from cookbot.

ddugovic avatar ddugovic commented on July 17, 2024

@pjwerneck Excellent suggestion! After that & after aligning the screenshot boxes I am now having some success. Perhaps I need to experiment with the spell-checker...

(I changed some logging.debug to logging.info as I don't see how to enable debug logging).

python app.py run
    INFO - Starting...
    INFO - {'dbfile': 'cookbot.db', 'key_delay': 0.1, 'auto_accept': True, 'canary': True, 'test_recipes': None, 'func': <function _run at 0x000000000B928B38>, 'auto_order': False, 'loop_delay': 0.1}
    INFO - Cache hit (7681.7854997091445): u'with yellow dog'
with yellow dog
SELECT food, title, recipe, finished_at FROM recipes WHERE title = with yellow dog
    INFO - Cache hit (7681.7854997091445): u'with yellow dog'
with yellow dog
SELECT food, title, recipe, finished_at FROM recipes WHERE title = with yellow dog
    INFO - Cache hit (7681.7854997091445): u'with yellow dog'
with yellow dog
SELECT food, title, recipe, finished_at FROM recipes WHERE title = with yellow dog
    INFO - Cache hit (7681.7854997091445): u'with yellow dog'
with yellow dog
SELECT food, title, recipe, finished_at FROM recipes WHERE title = with yellow dog
    INFO - Cache hit (7681.7854997091445): u'with yellow dog'
with yellow dog
SELECT food, title, recipe, finished_at FROM recipes WHERE title = with yellow dog
    INFO - Cache hit (7681.7854997091445): u'with yellow dog'
with yellow dog
SELECT food, title, recipe, finished_at FROM recipes WHERE title = with yellow dog
['C:/Program Files (x86)/Tesseract-OCR/tesseract.exe', 'c:\\users\\gaming\\appdata\\local\\temp\\tess_gojgg2.bmp', 'c:\\users\\gaming\\appdata\\local\\temp\\tess_rqssj9', '-l', 'eng', '--psm', '3', '-c', 'tessedit_char_whitelist=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,./!?()']
    INFO - Raw text: u'Jusf Mustard, please'
Traceback (most recent call last):
  File "app.py", line 92, in <module>
    main()
  File "app.py", line 69, in main
    args.func(args)
  File "app.py", line 26, in _run
    game.run()
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\bot.py", line 58, in run
    self.prepare()
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\bot.py", line 190, in prepare
    food = self.get_food()
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\bot.py", line 105, in get_food
    logging.error("Couldn't identify task: %r, %r" % (self.window.title, self.window.text))
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\window.py", line 103, in __getattr__
    value = getattr(self, 'get_' + attr)()
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\window.py", line 127, in get_text
    whitelist=string.letters + string.digits + ',./!?()')
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\ocr.py", line 66, in __call__
    text = self.spellchecker(text)
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\spellcheck.py", line 101, in __call__
    words = [self.correct(w) for w in words]
  File "C:\Users\Gaming\Desktop\cookbot\cookbot\spellcheck.py", line 77, in correct
    raise RuntimeError("No candidates for: %r" % word)
RuntimeError: No candidates for: u'jusf'

from cookbot.

pjwerneck avatar pjwerneck commented on July 17, 2024

@ddugovic Try adding "just" to the /data/SC_WORDS.csv file.

from cookbot.

ddugovic avatar ddugovic commented on July 17, 2024

@pjwerneck Thanks, that works great!

from cookbot.

pjwerneck avatar pjwerneck commented on July 17, 2024

@ddugovic Would you mind sending a PR? I'll check if it works on linux.

from cookbot.

ddugovic avatar ddugovic commented on July 17, 2024

@pjwerneck Certainly, I'd be glad to #2

from cookbot.

Related Issues (1)

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.