Giter Club home page Giter Club logo

toisto's People

Contributors

dependabot[bot] avatar fniessink avatar renovate[bot] avatar

Stargazers

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

Watchers

 avatar  avatar

toisto's Issues

basic commands result in an error on Windows

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.

image

I ran this on a Windows machine.

the command toisto practice also results in an error.

image

The config file is in the same dir as the progress file, the home dir

image

image

Allow for interrogatives and declarative sentences

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?"
        }
    }
}

Allow for specifying alternatives to randomise quizzes

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.

Confusing hint

With this quiz:

Give the plural in Finnish (female):
Hän on

the hint is unnecessary and confusing.

Make the concept usage relationship language specific

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"
    }
}

When the answer is incorrect, the correct answer is not linked

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

Quizzes with listening only

Next to quizzes with spoken and written text in the practice language also add quizzes with spoken text only.

Dependency Dashboard

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.

Detected dependencies

None detected


  • Check this box to trigger a request for Renovate to run again on this repository

Timeout when getting new version not caught

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)

Toisto doesn't take "use" relations between topic into account

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)

Meaning not shown for listen quizzes

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.

Allow for using gender within person

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"
            }
        }
    }
]

Simple change to make toisto work on Linux/windows

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.

Spaces being shown with underscores can be confusing

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".

Allow for specifying meaning without a label

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)"
        }
    }
}

Fix or document how to deal with "you" being both plural and singular in English

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.

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.