fniessink / toisto Goto Github PK
View Code? Open in Web Editor NEWCommand-line app to practice languages
License: Apache License 2.0
Command-line app to practice languages
License: Apache License 2.0
Here's a list of English/Dutch false friends: https://en.wikibooks.org/wiki/Dutch/Vocabulary/False_friends
And a list of English/several languages false friends : https://en.wiktionary.org/wiki/Appendix:Glossary_of_false_friends
I have created a config file in the home directory as described in the help page.
I ran the command
toisto topics --topic nature
And this resulted in an error.
I ran this on a Windows machine.
the command toisto practice also results in an error.
The config file is in the same dir as the progress file, the home dir
For example:
$ toisto fi nl --concept Christmas
For example
{
"there is a thunderstorm": {
"declarative": {
"en": "There is a thunderstorm|There's a thunderstorm",
"nl": "Het onweert"
},
"interrogative": {
"en": "Is there a thunderstorm?",
"nl": "Onweert het?"
}
}
}
For example, given this topic file:
{
"I have an X accent": {
"en": "I have a [Dutch|English|Finnish] accent",
"fi": "Minulla on [hollantilainen|englantilainen|suomalainen] aksentti",
"nl": "Ik heb een [Nederlands|Engels|Fins] accent"
}
}
Toisto would pick a random country for each quiz, but the quiz would not be considered to be different, even though the country may vary.
For example:
[
{
"adjective": {
"fi": "peini",
"nl": "klein"
},
"opposite": {
"fi": ["iso", "suuri"],
"nl": "groot"
}
}
]
With this quiz:
Give the plural in Finnish (female):
Hän on
the hint is unnecessary and confusing.
Translate into Dutch:
Huomenta
> morgen
⚠️ Incorrect. Please try again.
> de morgen
❌ Incorrect. The correct answer is "Goede morgen".
E.g.:
{
"white": {
"en": "White",
"fi": "Valkoinen",
"nl": "Wit"
},
"onion": {
"en": "Onion",
"fi": "Sipuli",
"nl": "De ui"
},
"garlic": {
"uses": {
"fi": ["white", "onion"]
},
"en": "Garlic",
"fi": "Valkosipuli",
"nl": "De knoflook"
}
}
Translate into Finnish:
De spin
> mäkähäri
⚠️ Incorrect. Please try again.
> ?
The correct answer is "Hämähäkki". # "Hämähäkki" is underlined
Translate into Dutch:
Piha
> vlees
⚠️ Incorrect. Please try again.
> het vlees
❌ Incorrect. The correct answer is "De tuin". # "De tuin" is not underlined
Currently, Toisto says Give the comparitive degree form in...
. Change this to Give the comparative degree in
.
Also note the spelling mistake.
Next to quizzes with spoken and written text in the practice language also add quizzes with spoken text only.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
None detected
In:
def latest_version() -> str | None:
"""Return the latest version."""
try:
return requests.get(TAGS_API_URL, timeout=2).json()[0]["name"]
except requests.ConnectionError:
return None
request.get
may also throw:
Traceback (most recent call last):
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
httplib_response = conn.getresponse()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1374, in getresponse
response.begin()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 318, in begin
version, status, reason = self._read_status()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 279, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py", line 705, in readinto
return self._sock.recv_into(b)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1274, in recv_into
return self.read(nbytes, buffer)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1130, in read
return self._sslobj.read(len, buffer)
TimeoutError: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 451, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 340, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.github.com', port=443): Read timed out. (read timeout=2)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/fniessink/Developer/toisto/venv/bin/toisto", line 8, in <module>
sys.exit(main())
File "/Users/fniessink/Developer/toisto/src/toisto/app.py", line 26, in main
argument_parser = create_argument_parser(config)
File "/Users/fniessink/Developer/toisto/src/toisto/ui/cli.py", line 125, in create_argument_parser
latest = latest_version()
File "/Users/fniessink/Developer/toisto/src/toisto/metadata.py", line 31, in latest_version
return requests.get(TAGS_API_URL, timeout=2).json()[0]["name"]
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/Users/fniessink/Developer/toisto/venv/lib/python3.10/site-packages/requests/adapters.py", line 578, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.github.com', port=443): Read timed out. (read timeout=2)
Not all nouns have plurals in all languages. Allow for missing plurals.
Toisto ignores apostrophe when checking answers:
Translate into Dutch:
Sohvat
> de sofas
✅ Correct.
Translate into Finnish:
De sofa's
Allow for replaying a listening exercise at a slower rate.
When a concept in one topic depends on a concept in a different topic, Toisto doesn't take this into account because the algorithm for selecting a next quiz only gets the quizzes of one topic at a time. This happens because eligible_quizzes()
only gets the quizzes of one topic at a time, so it can't see that a "used" concept has eligible quizzes unless that concept belongs to the same topic.
class Progress:
"""Keep track of progress on quizzes."""
...
def next_quiz(self, topics: Topics) -> Quiz | None:
"""Return the next quiz."""
for must_have_progress in (True, False):
for topic in topics:
if quizzes := self.__eligible_quizzes(topic.quizzes, must_have_progress):
self.__current_quiz = random.choice(list(quizzes))
return self.__current_quiz
self.__current_quiz = None
return None
def __eligible_quizzes(self, quizzes: Quizzes, must_have_progress: bool) -> Quizzes:
"""Return the eligible next quizzes from this set if possible."""
eligible = set(
quiz for quiz in quizzes if not self.__is_silenced(quiz) and not quiz.has_same_concept(self.__current_quiz)
)
concepts = set(quiz.concept_id for quiz in eligible)
eligible = set(quiz for quiz in eligible if not set(quiz.uses) & concepts)
eligible_with_progress = set(quiz for quiz in eligible if self.__has_progress(quiz))
return easiest_quizzes(eligible_with_progress if must_have_progress else eligible_with_progress or eligible)
These quizes (except the last one) don't show a meaning:
Listen and write in Finnish:
> meidän talomme
✅ Correct.
Listen and write in Finnish:
> teidän talonne
✅ Correct.
Listen and write in Finnish:
> heidän talonsa
✅ Correct.
Listen and write in Finnish:
> sinun talosi
✅ Correct.
Meaning "Jouw huis".
This is probably caused by Toisto using the en-fi concept instead of the nl-fi concept.
Give the plural in Finnish:
Ruoka
> ruoat
✅ Correct.
Meaning "Het voedsel", "".
Give the plural in Finnish:
Mämmi
> mämmit
✅ Correct.
Meaning "", "".
But take into account that some concepts may not have a plural or singular in the user's language.
Allow for replaying listening exercises as often as the user wants.
Something like the below should be possible so that when practicing Dutch-English or English-Dutch the female third person is not the correct answer for the male third person, but when practicing Finnish, both male and female version of Dutch and English are correct.
[
{
"singular": {
"third_person": {
"female": {
"en": "She has",
"nl": ["Zij heeft", "Ze heeft"]
},
"male": {
"en": "He has",
"nl": "Hij heeft"
},
"fi": "Hänellä on"
}
}
}
]
The only MacOs dependency is say
and afplay
.
There are equivalent (lots of) for them Linux and Windows.
We could use a config file file that where we can set the command which does the same thing on that OS
For eg on macos
audio-play-command: "say"
x-command: "afplay" # idk what afplay does
p.s. i think very few users will use the audio commands, most woul just use text based learning.
Listen and write in Finnish:
> heillä on kolme lasta ja kuusi lastenlasta
✅ Correct.
Meaning "Zij hebben drie kinderen en zes kleinkinderen|Ze hebben drie kinderen en zes kleinkinderen".
Skipping this quiz for 5 days.
Give the plural in Finnish:
Kauppakeskus
> kauppakeskukset
✅ Correct.
Grand! That's 5 times in a row. Skipping this quiz for 22 minutes.
Another correct answer is "ostoskeskukset".
Translate into Dutch:
Sarvi
> het hert
⚠️ Incorrect. Please try again.
> ?
❌ Incorrect. The correct answer is "De_hoorn".
It's not a typo in the topic file, but caused by the coloured diff function, because answering "de hoorn" works:
Translate into Dutch:
Sarvi
> De hoorn
✅ Correct.
Another example:
Translate into Dutch:
Norsut
> de varkens
⚠️ Incorrect. Please try again.
> de hoorns
❌ Incorrect. The correct answer is "De_olifanten".
For example, toisto fi --topic ./my_topics/ordering_food.json
For example, mämmi is a a traditional Finnish Easter dessert. Currently, it's specified in the topic file as follows:
{
"mämmi": {
"singular": {
"fi": "Mämmi"
},
"plural": {
"fi": "Mämmit"
}
}
}
If we would add an English label, "Finnish Easter dessert", Toisto would try to quiz the user on the translation. Allowing for specifying a meaning can indicate to Toista that it shouldn't present translation quizzes, but that it can show the meaning to the user. For example:
{
"mämmi": {
"singular": {
"fi": "Mämmi",
"en": "(Finnish Easter dessert)"
},
"plural": {
"fi": "Mämmit",
"en": "(Finnish Easter desserts)"
}
}
}
Currently, verbs look like this:
[
{
"singular": {
"first_person": {
"en": "I have",
"fi": "Minulla on",
"nl": "Ik heb"
},
"second_person": {
"en": "You have",
"fi": "Sinulla on",
"nl": ["Jij hebt", "Je hebt"]
},
"third_person": {
"en": ["He has", "She has"],
"nl": ["Hij heeft", "Zij heeft", "Ze heeft"],
"fi": "Hänellä on"
}
},
"plural": {
"first_person": {
"en": "We have",
"fi": "Meillä on",
"nl": ["Wij hebben", "We hebben"]
},
"second_person": {
"en": "You have",
"fi": "Teillä on",
"nl": "Jullie hebben"
},
"third_person": {
"en": "They have",
"fi": "Heillä on",
"nl": ["Zij hebben", "Ze hebben"]
}
}
}
]
This means that users practicing from or to English may get the quiz to translate from or to "You have" and have no way of knowing whether Toisto means the plural or the singular version. Only one will be considered correct by Toisto because it doesn't know that they are the same.
Having to enter two fake answers if you don't know the answer is annoying.
Instruction: "To read more about an underlined word: keep ⌘ (the command key) pressed while clicking the word. Not all terminals may support this."
Since neither Dependabot or Renovatebot supports pyproject.toml yet, this issue is waiting.
For example:
{
"to paint": {
"positive": {
"en": "I paint",
"nl": "Ik schilder"
},
"negative": {
"en": "I don't paint",
"nl": "Ik schilder niet"
}
}
}
For example:
{
"to paint": {
"infinitive": {
"en": "to paint",
"nl": "schilderen"
}
}
}
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.