Skip to content

Commit

Permalink
[th] Fix handling of digit 1
Browse files Browse the repository at this point in the history
Apparently the digit 1 is written as "เอ็ด" only if it is the last
digit in an multidigit integer part of a number. So 1100 should be
written as "หนึ่งพันหนึ่งร้อย" and not as "หนึ่งพันเอ็ดร้อย".
  • Loading branch information
IdamkinI committed Feb 8, 2019
1 parent 163afea commit 6b5fc3b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions data/th.sor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
^0 ศูนย์
^1 หนึ่ง
1 เอ็ด
^1$ หนึ่ง
1$ เอ็ด
1 หนึ่ง
2 สอง
3 สาม
4 สี่
Expand Down Expand Up @@ -47,12 +48,12 @@

# currency

"THB ([-−]?\d+)" $1บาทถ้วน
"THB ([-−]?\d+)" |$1|บาทถ้วน

# currency with decimals

"(THB [-−]?\d+)[,.]00" $1
"THB ([-−]?\d+)[,.](\d{1,2})" $1บาท$2สตางค์
"THB ([-−]?\d+)[,.](\d{1,2})" |$1|บาท$2สตางค์

# other currencies?

Expand Down

11 comments on commit 6b5fc3b

@tyindeepit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this issue is still happening. One can reproduce with website demo.

@IdamkinI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no control over what is on the website. Can't reproduce when building from source.

@tyindeepit
Copy link
Contributor

@tyindeepit tyindeepit commented on 6b5fc3b Aug 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happened with LibreOffice extension too.
Now I think I know why. This fix was in Feb of this year. While both LO extension and latest release was since Oct 18. So it has old code.

Please advice on how I can make the LO extension myself. I need the fixed version as soon as possible.

edit: I'm coding illiterate. But very willing to try.

@IdamkinI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in the read me, just run the make -f Makefile.orig lo in the root directory of cloned repository

@tyindeepit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IdamkinI Thank you for the direction. I'll work on it when I get to my PC later today.

@tyindeepit
Copy link
Contributor

@tyindeepit tyindeepit commented on 6b5fc3b Sep 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IdamkinI Hello again. I tried to 'make' the extension myself but I may be too stupid to properly setup Git, bash, Java, and other things that I couldn't, no matter how I tried, successfully build the extension.

I cloned the repo using Github Desktop but have no idea what to do with it nor how to run the command you suggested. In cmd, I still can't run 'make' command within the extension root directory. In Git Bash, there's no 'make' command to call. I checked out 'Atom', but also was dumbfounded by everything.

Could you please provide a clearer, more elaborate instruction how to make the build?
OS: Windows 10
Installed: JDK 12, Git + Git Bash, Github Desktop, Atom, and Python (don't know if relevant)

@IdamkinI
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @nicorobinhood!

The build procedures in this repository is mostly set up for Linux users.

On Windows 10 for such cases I would recommend getting Ubuntu for Windows (please pay attention to the installation instructions you may need to configure something in Windows settings)

After that when you run this app and finish the installation (it may take a while but the prompts are quite descriptive) you'll get to Ubuntu command line from which you can run most of Linux commands.
All the commands described next, should be written in Ubuntu for Windows command line.

First you'll need to navigate to cloned source folder (you've unpacked the .zip downloaded from Git Hub, right?) if it is at C:\path\to\source\folder executing cd /mnt/c/path/to/source/folder should do the trick.

Now you would need to install all required dependencies:
First run sudo apt-get update and then sudo apt-get upgrade

Now you can install applications by running sudo apt-get install <name-of-application>
For example to install make you would need to run sudo apt-get install make.

Now you can run make, it will probably fail, since you'll need to install some other dependencies like Python (they are separate from the ones installed in Windows) but in general if make fail with something like python: command not found than you'll just need to run sudo apt-get install python and rerun make (same with any other missing command). In that way one by one you will install all dependencies and make should be successful.

Hope it helps!

@laszlonemeth
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I am going to update the code in LibreOffice and on the website soon. Sorry for being late. Thanks for your feedback, László

@tyindeepit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IdamkinI I seriously thank you for spending time answering my noob question with all these details. I don't know why I never thought of 'not' using Windows to build it. Not I can anyway. I'll try again with Ubuntu for Windows. Hopefully I can do it without a hitch this time.

@laszlonemeth Thanks for your update and the update that is coming. No rush! I will try to build it myself in the mean time.

@tyindeepit
Copy link
Contributor

@tyindeepit tyindeepit commented on 6b5fc3b Sep 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IdamkinI I have succesfully built the extension. Thanks to your guidance. Installing Ubuntu and dependencies was a smooth ride, but I couldn't 'make' the extension on the first try though. I suspect it has something to do with the cloned repository so this might also concern @laszlonemeth.

Via Github Desktop, the repo was cloned into folder name 'libnumbertext' and no matter how I tried to 'make' it would error out. Error text at pastebin here. I don't understand the error. In the cloned repo, after I run the command, the folder 'pythonpath' was created and a bunch of files were created inside, the folder 'web' was created but nothing was copied into the folder.

How did I succeed? I deleted the cloned repo and started over by manually downloaded as zip file. When I extracted the files (to the exact same root directory) I noticed that the folder name was 'libnumbertext-master'. This time I could make the extension on the first try. No error. No hiccup.

I could only guess that the issue has something to with how the cloned repository folder was named which might be clashing with some manifest file inside? This error is reproduce-able by just naming the repo folder as 'libnumbertext'. I've reproduced it at least 10 times (counting both the genuine first attempts and the reproduce tries). Please look into this. Or if this is a non-issue please spare some time to explain, that would be really appreciated.

@laszlonemeth
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I've updated the web site, so also the web editor contains the newest Thai module, see "th" (Thai) in the pop-up menu "load":

https://numbertext.github.io/Soros.html

Please sign in to comment.