Difference between revisions of "Language/Multiple-languages/Culture/Numeration-Tutorial"

From Polyglot Club WIKI
Jump to navigation Jump to search
Tags: Mobile edit Mobile web edit
Line 51: Line 51:
=== If you are using Linux and the latest Python is not available in the depository ===
=== If you are using Linux and the latest Python is not available in the depository ===
You need to manually download and install the latest Python as described in [https://opensource.com/article/20/4/install-python-linux this article]. The pip version needs to be specified like “pip3.9”, so the operating system won't call the default old one and install ruamel.yaml for the old version. When the project is opened in PyCharm, go to "File -> Settings -> Project: Numeration -> Python Interpreter -> Python Interpreter -> Show All -> + (Add)", select "Existing Environment", make sure it is the latest version.
You need to manually download and install the latest Python as described in [https://opensource.com/article/20/4/install-python-linux this article]. The pip version needs to be specified like “pip3.9”, so the operating system won't call the default old one and install ruamel.yaml for the old version. When the project is opened in PyCharm, go to "File -> Settings -> Project: Numeration -> Python Interpreter -> Python Interpreter -> Show All -> + (Add)", select "Existing Environment", make sure it is the latest version.
You may have guessed it: if a newer version of Python is available and you want to use that version, you need to install packages like ruamel.yaml for the new versions again.


== Why choose Apache 2.0? ==
== Why choose Apache 2.0? ==

Revision as of 11:43, 7 November 2020

Finally, the first version of the Numeration tool is released! This version will allow you to practise Chinese, English, Esperanto, German and Japanese numerals! More languages to come...

Numeration 20201106.png

What is the Numeration tool?

This tool will help you practise reading, writing (hopefully also listening and speaking) numbers, written in Python and YAML.

The Numeration project is for practising conversion of numbers between symbols and writing systems.


Address: https://gitlab.com/GrimPixel/Numeration


NB: It would be ridiculous to post this tutorial on GitLab, because this tutorial's target readers are non-programmers, so it is too detailed for programmers.

What are Python and YAML and why choose them?

Python

Python is one of the most favoured languages.

Why not Rust or TypeScript, but Python? Well, because Python codes are very easy to maintain, Python also has some unique useful features including f-string and negative indexing. In addition, Python has a lot of scientific libraries, so it is more relevant to my main area of study.

YAML

YAML is one of the most useful data serialization formats.

And why not JSON or TOML, but YAML? Because YAML has high readability and is very easy to maintain, at least no need to type soo many quotation marks.

By the way, XML is not that horrible as described in that linked page. That is a joke with escape characters.

How to get started with Numeration?

1. Download the latest Python and install it, so you can run Python programs. For Linux users, the latest version can be installed following this article.

2. Download PyCharm, an integrated development environment (IDE), and install it, so you have a graphical user interface (GUI) to edit the code or run it. Alternative: Pyzo.

3. Download Python's YAML parser, so that Python interpreter of the default version can understand YAML. If you are using Windows, tap WinKey, input "cmd", tap Enter, so the command line is opened. Copy the line starting with "pip" in that webpage, paste into the command line window, tap Enter. For users of other operating systems, you should already have known how to open the command line of your system, I suppose.

They are all open-source.

After doing this, go to that Address above. Download the source code and extract the compressed file. Keep the directory structure unchanged, otherwise you need to change the code to run the program.

Open PyCharm, open the project directory, open 'numerate.py'. You can go to “File -> Settings -> Appearances & Behavior -> Appearance” to change the font and its size.

Tap "Ctrl + Shift + F10" to run the code in current tab. Tap "Shift + F10" to run the code in the file specified on the upper-right corner.

You can go to 'rule/library/setting.yaml' and change the settings following the comment.

If you are using Linux and the latest Python is not available in the depository

You need to manually download and install the latest Python as described in this article. The pip version needs to be specified like “pip3.9”, so the operating system won't call the default old one and install ruamel.yaml for the old version. When the project is opened in PyCharm, go to "File -> Settings -> Project: Numeration -> Python Interpreter -> Python Interpreter -> Show All -> + (Add)", select "Existing Environment", make sure it is the latest version.

You may have guessed it: if a newer version of Python is available and you want to use that version, you need to install packages like ruamel.yaml for the new versions again.

Why choose Apache 2.0?

I want to let people use this even commercially, e.g. in language-learning games like Influent. Thus I need a permissive license. You may ask why not public domain. It's disputable whether people can truly release software in public domain when they are alive.

MIT is good, but there is a problem: it doesn't explain how to deal with patents and trade marks. This allows patent trolls to sue those who use the code commercially without knowing that it contains patent. When the MIT license came into being, there were no many software patent issues, so the license can be called outdated.

A guy named Lawrence E. Rosen created the Academic Free License to deal with this issue and this idea was incorporated into Apache 2.0, a better alternative.

What's the future plan?

I need to add support to other languages mentioned in 'about/language.yaml' and notations mentioned in 'about/notation.yaml', then I will start supporting other languages covering as many language families as possible, so that people can copy the code of the language in the same family, modify it to support a new language. I will add a guidance on adding a new language, add the TTS support and maybe the SR support, create a GUI with BeeWare. I need to accumulate experience through this project, then I can create other ones.