Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Implement spelled out for Māori #54

Open
wants to merge 155 commits into
base: master
Choose a base branch
from
Open

Draft: Implement spelled out for Māori #54

wants to merge 155 commits into from

Conversation

jakewilliami
Copy link
Owner

No description provided.

jakewilliami and others added 30 commits October 23, 2020 15:57
Added OS BSD to .travis.yml
Implemented floating point spelled out (closes #14)
Began work on complex numbers (addresses #15)
Removed 1.0 from travis testing, as DecFP requires 1.3 or greater
I'm not sure how I was aiming to implement it previously, as it has
been a while since I've worked on this project, but I implemented
numbers up to 999 this evening.  It certainly doesn't feel as though I
am doing this the most efficient way, but premature optimisation is
the root of all evil; I can optimise once it is working.  Overall,
this commit has made good progress.
I'm not sure how I was aiming to implement it previously, as it has
been a while since I've worked on this project, but I implemented
numbers up to 999 this evening.  It certainly doesn't feel as though I
am doing this the most efficient way, but premature optimisation is
the root of all evil; I can optimise once it is working.  Overall,
this commit has made good progress.
@jakewilliami
Copy link
Owner Author

Made some good progress tonight: at a7e63b8 the Māori test results were:

Test Summary: | Pass  Error  Total  Time
Māori         |   28     33     61  3.0s

Now (at e233741), they are:

Test Summary: | Pass  Fail  Error  Total  Time
Māori         |   43     1     17     61  7.6s

In Māori's (mi) implementation of spelled_out, there is a special case
in which 1xx and 1xxx numbers start with _ko_tahi (rather than just
tahi, which is the equivalent of one).  If the number is > 99 and is
not 1xx or 1xxx, we need to use the first digit.  I initially wrote
the first digit as d being n ÷ 10, however this is not correct when n
> 1000, so we have to account for order of magnitude
In Māori's (mi) implementation of spelled_out, there is a special case
in which 1xx and 1xxx numbers start with _ko_tahi (rather than just
tahi, which is the equivalent of one).  If the number is > 99 and is
not 1xx or 1xxx, we need to use the first digit.  I initially wrote
the first digit as d being n ÷ 10, however this is not correct when n
> 1000, so we have to account for order of magnitude
@jakewilliami
Copy link
Owner Author

Since 7b8e491, doing better still:

Test Summary: | Pass  Fail  Error  Total  Time
Māori         |   52     6      3     61  4.1s

Still to do:

  • Implement evaluation strings for empty tests
  • Implement commas:
Māori: Test Failed at /Users/jakeireland/projects/SpelledOut.jl/test/runtests.jl:114
  Expression: spelled_out(1982, lang = :mi) == "kotahi mano, iwa rau, waru tekau mā rua"
   Evaluated: "kotahi mano waru tekau mā rua" == "kotahi mano, iwa rau, waru tekau mā rua"
  • Account for numbers ≥ 10,000

@jakewilliami jakewilliami changed the title WIP: Implement spelled out for Māori Draft: Implement spelled out for Māori Sep 22, 2022
Requires heavy cleaning, but still just uncovering patterns etc.  In
fact, the basic implementation is nearly complete!  Aside from a stray
comma that may or may not be needed, and some larger number scales,
this is done.  Then I will be able to clean it up and decouple some
patterns.

I'm really pleased with how this is turning out.  It's neat that I
can't find any implementation of this before now, and I'm pleased that
it's almost finished, despite my busy schedule (I haven't worked on it
in a while, but picked it up again tonight in the spirit of
procrastination).

Once the basic implementation is done, I will be able to ensure this
works for negative numbers, and possibly ordinal numbers (we will
see).  After that I should be able to merge it into trunk and make a
release!

There are also a few semantics I need to check on, but these would be
minor changes.
@jakewilliami
Copy link
Owner Author

The primary questions I have had are:

  • How do you say 100? (Kotahi or kotahi rau?) What about 9,100? (Iwa mano, kotahi, or iwa mano, kotahi rau?)
  • Are there modifiers for very large numbers? For example, we have mano for thousand, miriona for one thousand thousand (one million), and piriona for one thousand million (one billion). Are there words for one trillion (one thousand billion), or one quadrillion (one thousand trillion)? What about higher?
  • When do we use kotahi vs. tahi to mean "one"? (I have seen both.)
  • What do you say for negative numbers? In English, you can write "negative one-hundred," or "minus one-hundred."
  • Where do I put commas in large numbers, or example, 1984? I have seen this written without commas (kotahi mano iwa rau waru tekau mā whā), or with commas between each order of magnitude (kotahi mano, iwa rau, waru tekau mā whā). or with just one comma (kotahi mano, iwa rau waru tekau mā whā).

I have asked some people these questions, but I'm still trying to find kaumātua to provide me with assurance that I am doing this correctly.

Some important questions to ask:

  • What is the rationale as to why you would use numbers in te reo Māori?
  • How do numbers in any shape or form benefit our whānau?
  • Do the numbers tell a narrative or more so have a whakapapa?

The goal of the project as a whole (not te reo specific) is to provide a programmatic interface to writing out numbers in long form. Specifically for te reo Māori, I am proud of our culture and language. I think this functionality is useful in many contexts, from simply providing readable metrics in areas such as report writing or data science, to natural language processing and machine learning. Providing this functionality for te reo Māori enables the use of this library throughout Aotearoa—I particularly see this as being useful in government, where language and accessibility is most important. I think this benefits our whānau/Aotearoa, simply in providing visibility and accessibility to te reo Māori. The numbers output from this programme do not tell a narrative, as it entirely depends on the use case. This programme is a library, to be used in others' programmes.

That said, I'm curious to know how this is done in computer science. My intentions with this library are good, and I genuinely think that the accessibility this would enable is beneficial, but you can't necessarily be sure that everyone who uses this library has good intentions, no? Same can be said for any library. I'd be interested to know how this is tackled in computer science.

Not all spelled out outputs are in Anglo-Saxon form
@jakewilliami
Copy link
Owner Author

Other questions:

  • How did Māori write before Europeans?
  • Consider regional differences and Elsdon Best's article on vigesimal numeration.

Note also, regarding big numbers, that if you think of navigation by the many stars, I'm sure there would have been numbers or co-ordinates that map their geographical and spatial dimensions of time to land. So I suspect there are numbers that are large, or in some way relevant in this area. Still unsure about the modifiers question, though.

Maori Numeration.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants