letterfowl / platyrhynchos Goto Github PK
View Code? Open in Web Editor NEWConcatenation-based crossword generator
License: Other
Concatenation-based crossword generator
License: Other
This can use the old collision detection algorithm.
Describe the bug
While generating crosswords in Pyodide, an exception rises sometimes:
Uncaught (in promise) PythonError: Traceback (most recent call last):
File "/lib/python311.zip/_pyodide/_base.py", line 540, in eval_code_async
await CodeRunner(
File "/lib/python311.zip/_pyodide/_base.py", line 365, in run_async
await coroutine
File "<exec>", line 8, in <module>
File "/lib/python3.11/site-packages/platyrhynchos/director/direct_search.py", line 16, in generate_crossword
word, colrow = await cruciverbalist.choose_and_fill(crossword)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/site-packages/platyrhynchos/cruciverbalist/base.py", line 62, in choose_and_fill
return await self.find_word(colrows)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/site-packages/platyrhynchos/cruciverbalist/base.py", line 54, in find_word
choice = random.choices(words, weights=list(range(len(words))), k=1)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python311.zip/random.py", line 509, in choices
raise ValueError('Total of weights must be greater than zero')
ValueError: Total of weights must be greater than zero
PythonError https://cdn.jsdelivr.net/pyodide/v0.23.1/full/pyodide.asm.js:9
new_error https://cdn.jsdelivr.net/pyodide/v0.23.1/full/pyodide.asm.js:9
_PyCFunctionWithKeywords_TrampolineCall https://cdn.jsdelivr.net/pyodide/v0.23.1/full/pyodide.asm.js:9
pyodide.asm.js:9:105278
a http://localhost:8080/main.js:971
<anonymous> webpack-internal:///./src/index.js:27
AsyncFunctionThrow self-hosted:760
(Async: setTimeout handler)
hiwire_call_bound https://cdn.jsdelivr.net/pyodide/v0.23.1/full/pyodide.asm.js:9
Additional context
It might be due to lack of words
Create a Polish version of EnglishSimpleCruciverbalist
class
Is your feature request related to a problem? Please describe.
DB query speed on Pyodide is deficient - every query takes around ~1.5 seconds to be sent to a server, executed and returned.
Describe the solution you'd like
I have some ideas:
Describe alternatives you've considered
Is your feature request related to a problem? Please describe.
Low test coverage
Describe the solution you'd like
Testing of add
, addLetter
and rotate
functions.
Describe alternatives you've considered
crossword/base.py
- not used currentlycrossword/addable.py
testing - not used currentlycrossword/addable.py
, and related functions from the main branch.The last one will probably be done while at it.
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Representing a single word as an object with a list of all other words that interact with it (maybe via a field class?). Depending on the type of interaction, these might be considered a good thing or a bad thing.
This would require rewriting the crossword libs.
Describe alternatives you've considered
Random choice, wrappers, simple backtracking with copying, adding a child class.
Additional context
I thought about it when thinking about action representation. It's somewhat similar to how Larch backtracking worked.
Sometimes the crossword contains words unbeknownst to the generator. Let's scan for them using full-text search (?).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.