-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from neelsmith/dev
Add parsing Milesian strings into numeric values
- Loading branch information
Showing
19 changed files
with
625 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: TagBot | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
jobs: | ||
TagBot: | ||
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JuliaRegistries/TagBot@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ssh: ${{ secrets.DOCUMENTER_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Large values | ||
|
||
|
||
## Using integer values in hexadecimal units | ||
|
||
|
||
::: {.callout-note title="TBA"} | ||
|
||
An alternative to tedious sums of fractions: | ||
|
||
- divide whole units into sixtieths, seconds (3600ths), thirds (216000ths)... each written with an integer value up to 59 | ||
- typically used in tables where columns determine meaning of integer | ||
- but manually written columns make null values dangerous if they're left blank, so adds special character `Ο` (οὐδέν, "nothing") for 0. | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
# Formatting numeric tokens | ||
```{julia} | ||
#| warning: false | ||
#| echo: false | ||
#| output: false | ||
using GreekScientificOrthography, Orthography | ||
``` | ||
|
||
Manuscripts of Greek scientific and mathematical texts use the "Milesian" system of numeric notation. | ||
|
||
## Integers in the "Milesian" system of notation | ||
|
||
### Values from 1-999 | ||
|
||
The Milesian system is essentially a place-value system. The 27 values for ones (1-9), tens (10-90), and hundreds (100-900) are noted with specific alphabetic characters in normal alphabetic order, with the additions of `ϛ` for 6, `ϙ` for 90 and `ϡ` for 900. | ||
|
||
::: {.callout-note} | ||
Note that in `GreekScientificOrthography`, characters used to write the basic integer values *must be in lower-case*. | ||
::: | ||
|
||
|
||
::: {.column width="50%"} | ||
|
||
| Ones | Tens | Hundreds | | ||
| --- | --- | --- | | ||
| α | ι | ρ | | ||
| β | κ | σ | | ||
| γ | λ | τ | | ||
| δ | μ | υ | | ||
| ε| ν | φ | | ||
| ϛ | ξ | χ | | ||
| ζ| ο | ψ | | ||
| η| π | ω | | ||
| θ | ϙ | ϡ | | ||
|
||
::: | ||
|
||
|
||
Since most of the characters used to write integers in the Milesian system can also be read as alphabetic characters, integer tokens are flagged with a special marker, the numeric tick mark, `ʹ` (Unicode x0374). The integer value `1` is written like this: | ||
|
||
```{julia} | ||
#| output: false | ||
one = "αʹ" | ||
``` | ||
|
||
|
||
|
||
Like our place value notation, the left-to-right sequence of digits is always largest to smallest. Note that unlike our numeric notation, there is no need for a zero character to represent the absence of a value in the hundreds, tens or ones column, since the characters for each column are distinct. | ||
|
||
|
||
```{julia} | ||
#| output: false | ||
eleven = "ιαʹ" | ||
one_hundred_one = "ραʹ" | ||
one_hundred_eleven = "ριαʹ" | ||
``` | ||
|
||
All of these are valid strings in a `GreekSciOrthography`. | ||
|
||
```{julia} | ||
ortho = stemortho() | ||
validstring(one, ortho) == validstring(eleven, ortho) == validstring(one_hundred_one, ortho) == validstring(one_hundred_eleven, ortho) | ||
``` | ||
|
||
|
||
A comma separates a thousands column (with values from 1,000 - 9,000) to the left of the comma, from hundreds, tens and ones values to the right of the comma, again just like our practice. The thousands column reuses the same characters as the ones column. | ||
|
||
```{julia} | ||
one_thousand_one = "α,αʹ" | ||
validstring(one_thousand_one, ortho) | ||
``` | ||
|
||
All of these strings represent a single integer token (type `MilesianIntegerToken`). | ||
|
||
```{julia} | ||
tokenize(one, ortho) | ||
``` | ||
|
||
|
||
```{julia} | ||
tokenize(one_thousand_one, ortho) | ||
``` | ||
|
||
## Integers from 999-19,999 | ||
|
||
The value for 10,000 is written with the upper-case mu, `Μ` (for μυριάς, "myriad"). | ||
|
||
```{julia} | ||
myriad = "Μʹ" | ||
validstring(myriad, ortho) | ||
``` | ||
|
||
Conventionally, the myriads value is written as a separate token separated by white space from the smaller columns. That means that the string for a value like 10,001 will be represented by two tokens. | ||
|
||
```{julia} | ||
tenthousand_one = "Μʹ αʹ" | ||
tokenize(tenthousand_one, ortho) | ||
``` | ||
|
||
::: {.callout-note} | ||
Greek manuscripts do not normally repeat the tick mark on the myriad marker; `GreekScientificOrthography` requires this to guarantee context-independent parsing of tokens. | ||
::: | ||
|
||
|
||
You can express whole numbers up to 19,999 in this way. | ||
|
||
```{julia} | ||
nineteen_999 = "Μʹ θ,ϡϙθʹ" | ||
validstring(nineteen_999, ortho) | ||
``` | ||
|
||
```{julia} | ||
tokenize(nineteen_999, ortho) | ||
``` | ||
|
||
|
||
## Integers greater than 19,999 | ||
|
||
To write values larger than 19,999, Milesian notation begins by multiplying the myriad character. In manuscripts, the multiplier is normally written above the `Μ`; in `GreekScientificOrthography`, we use the markdown convention for superscript that is supported by pandoc, among others, of bracketing the superscript value with carets. In this context, neither multiplicand requires the numeric tick. | ||
|
||
20,000, for example, is written as Μ multiplied by β, like this example: | ||
|
||
```{julia} | ||
twentyk = "Μ^β^" | ||
validstring(twentyk, ortho) | ||
``` | ||
|
||
|
||
In an environment that supports pandoc's markdown extension, the multiplier will display as a superscript. | ||
|
||
```{julia} | ||
using Markdown | ||
Markdown.parse(twentyk) | ||
``` | ||
|
||
|
||
Archimedes uses this notation as he derives limiting values for *pi* in his treatise *Measurement of a Circle*. The value 349,450, for example, is written with these two tokens: | ||
|
||
```{julia} | ||
threefortynine450 = "Μ^λδ^ ,θυνʹ" | ||
Markdown.parse(threefortynine450) | ||
``` | ||
|
||
```{julia} | ||
tokenize(threefortynine450, ortho) | ||
``` | ||
|
||
|
||
|
||
## Fractional values | ||
|
||
`GreekScientificOrthography` includes characters for three fractional values that are often written in manuscripts with special symbols: `𐅵` for one half (Unicode x10175), `𐅷` for two-thirds (Unicode x10177), and `𐅸` for three quarters (Unicode x10178). (The package also makes these characters available with the contsant names `ONE_HALF`, `TWO_THIRDS` and `THREE_FOURTHS`.) | ||
|
||
Apart from these special cases, the only notation for fractional values available to Greek mathematicians was to use normal integer notation, but flagged with a special double-prime marker indicating that this is a *reciprocal* value. | ||
|
||
```{julia} | ||
sixth = "ϛ″" | ||
thirtysixth = "λϛ″" | ||
validstring(sixth, ortho) == validstring(thirtysixth, ortho) | ||
``` | ||
|
||
Other fractional values would be written as sums of these. The fraction 2/3 can, for example, appear as 1/2 + 1/6, written simply as a succession of individual fractional tokens. As with integer values, the left-to-right sequence is from greatest to least, and the value of the sum of the tokens. | ||
|
||
```{julia} | ||
twothirds = "β″ ϛ″" | ||
tokenize(twothirds, ortho) | ||
``` | ||
|
||
Fractions can of course be mixed with integer numbers. | ||
|
||
```{julia} | ||
six_and_twothirds = "ϛʹ β″ ϛ″" | ||
validstring(six_and_twothirds, stemortho()) | ||
``` | ||
|
||
|
||
```{julia} | ||
tokenize(six_and_twothirds, stemortho()) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,10 @@ | ||
--- | ||
title: Tutorials | ||
title: Hands-on tutorials | ||
--- | ||
|
||
|
||
## Quick start | ||
|
||
- Validate the orthography of a string: | ||
|
||
```{julia} | ||
using GreekScientificOrthography, Orthography | ||
ortho = stemortho() | ||
archimedes = "ἡ ΓΕ πρὸς ΓΗ μείζονα λόγον ἔχει ἤπερ φοαʹ πρὸς ρνγʹ." | ||
validstring(archimedes, ortho) | ||
``` | ||
|
||
|
||
- Tokenize a string: | ||
|
||
```{julia} | ||
tkns = tokenize(archimedes, ortho) | ||
``` | ||
|
||
|
||
## Hands-on tutorials | ||
|
||
|
||
- [validating and tokenizing strings](./tokens.qmd) | ||
- [formatting numeric tokens](./numbers.qmd) | ||
- [Validating and tokenizing strings](./tokens.qmd) | ||
- [Evaluating numeric values](./numbers.qmd) | ||
|
Oops, something went wrong.