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

0.2.0 #10

Merged
merged 273 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
e2c071b
implement preverb in ast
neverRare Jan 12, 2024
5c313cd
further implement preverbs
neverRare Jan 12, 2024
333f510
implement modifier parser and more helper functions
neverRare Jan 12, 2024
0d058c0
add many combinator
neverRare Jan 12, 2024
674ac72
small change
neverRare Jan 12, 2024
8fc5fa2
implement phrase parser and small changes
neverRare Jan 12, 2024
d811ae8
implement recursive combinator to avoid infinite loop
neverRare Jan 12, 2024
b8c7271
fix infinite loop
neverRare Jan 12, 2024
e8bae37
format
neverRare Jan 12, 2024
5c34770
implement multiple parsers
neverRare Jan 12, 2024
2ab3246
add prepositional predicate
neverRare Jan 12, 2024
62bb586
implement full clause
neverRare Jan 12, 2024
53c4145
implement full clause and sentence parser
neverRare Jan 12, 2024
fa402af
order matters
neverRare Jan 12, 2024
ed964bf
order matters
neverRare Jan 12, 2024
c7959f0
small change
neverRare Jan 12, 2024
9a5a08f
separate error
neverRare Jan 12, 2024
4d52377
change error handling
neverRare Jan 12, 2024
bb6cd50
separate output
neverRare Jan 12, 2024
f46cc5c
add translation module
neverRare Jan 12, 2024
2ca830c
update changelog
neverRare Jan 12, 2024
8fde620
update changelog
neverRare Jan 12, 2024
3903f56
formatting fix
neverRare Jan 12, 2024
1abc00a
update errors
neverRare Jan 12, 2024
716ddce
whoops
neverRare Jan 12, 2024
6306466
period
neverRare Jan 12, 2024
a5623d9
add final parser function
neverRare Jan 12, 2024
3a74c24
format
neverRare Jan 12, 2024
89b4076
update changelog
neverRare Jan 12, 2024
a22546c
prepare translator
neverRare Jan 12, 2024
a9857f5
add test-parser.ts and include .ts on every path
neverRare Jan 12, 2024
07ec600
use deno
neverRare Jan 12, 2024
bfa1261
use deno formatter
neverRare Jan 12, 2024
5df0395
add language code to html
neverRare Jan 12, 2024
0e67858
update changelog
neverRare Jan 12, 2024
19a96cc
order matters
neverRare Jan 12, 2024
dfc6131
add todo for x ala x constructions
neverRare Jan 12, 2024
79913ff
add X ala X constructions to limitations
neverRare Jan 12, 2024
9763dcc
o predicates no longer requires subject
neverRare Jan 12, 2024
716c73a
update limitations
neverRare Jan 12, 2024
f808323
update notes for new limitation
neverRare Jan 12, 2024
8d7f79b
update limitations
neverRare Jan 12, 2024
7f46c93
remove todo
neverRare Jan 12, 2024
0717a0f
update translation
neverRare Jan 12, 2024
ed8adb5
small change
neverRare Jan 12, 2024
43be701
further establish the sorry
neverRare Jan 12, 2024
be2ba6a
small formatting edit
neverRare Jan 12, 2024
0d5055b
rewritten parser combinators to use more functional style
neverRare Jan 13, 2024
6e72d56
functional programming FTW!
neverRare Jan 13, 2024
4a26288
we don't need this
neverRare Jan 13, 2024
1622cf9
rename recursive to lazy
neverRare Jan 13, 2024
cb58d59
order matters
neverRare Jan 13, 2024
3e17a72
reintroduce "all" combinator
neverRare Jan 13, 2024
d50eb05
minimize effectful methods
neverRare Jan 13, 2024
a819649
allow any
neverRare Jan 13, 2024
48962d6
move map complexity above
neverRare Jan 13, 2024
4d53b4a
avoid empty error
neverRare Jan 13, 2024
790027f
create unique error type for output
neverRare Jan 13, 2024
54ed0a1
output constructor now have optional parameter
neverRare Jan 13, 2024
c8c119a
small edit
neverRare Jan 13, 2024
2a0dfbe
allow null and undefined in optional parameter
neverRare Jan 13, 2024
3fa3f8d
further establish the parameter is now optional
neverRare Jan 13, 2024
427be7d
lint
neverRare Jan 13, 2024
8c1cac4
small change
neverRare Jan 13, 2024
a24ca5f
fix error
neverRare Jan 13, 2024
5951261
more error fixed
neverRare Jan 13, 2024
ea4f527
ensure error is provided when the array is empty
neverRare Jan 14, 2024
4aef606
include documentation comments
neverRare Jan 14, 2024
d93ccb8
include kepeken in content word set
neverRare Jan 14, 2024
8441913
update limitations
neverRare Jan 14, 2024
c00fc0a
include kepeken for consistency
neverRare Jan 14, 2024
2f92a2d
add parser for ordinal modifier
neverRare Jan 14, 2024
5d54874
implement cardinal for phrases
neverRare Jan 14, 2024
e808ed3
implement anu seme as special postclause
neverRare Jan 14, 2024
4801d25
ass anu seme as special clause
neverRare Jan 14, 2024
edfec29
implement "e" object parser
neverRare Jan 14, 2024
62e6b12
improve comments
neverRare Jan 14, 2024
da54080
improve comment
neverRare Jan 14, 2024
9f2219b
implement X ala X parser
neverRare Jan 14, 2024
87a421d
fix error
neverRare Jan 14, 2024
50dffa8
whoops, I forgot to remove this
neverRare Jan 14, 2024
8b3eef4
allow other punctuation
neverRare Jan 14, 2024
246fb74
improve comments
neverRare Jan 14, 2024
b373735
allow prepositions to be modified
neverRare Jan 14, 2024
50ea32f
revert map function implementation for speed
neverRare Jan 14, 2024
87b94d1
add missing comment
neverRare Jan 14, 2024
aee9a2f
improve error handling in test-parser.ts
neverRare Jan 14, 2024
677ccc4
update changelog
neverRare Jan 14, 2024
c140d37
improve function naming
neverRare Jan 14, 2024
100fec3
add modifiers for preverb
neverRare Jan 15, 2024
45f0267
support ali for number words
neverRare Jan 15, 2024
ad59579
Move limitation to wiki
neverRare Jan 15, 2024
799214d
implement multiple sentence parser
neverRare Jan 15, 2024
773610b
fix error handler
neverRare Jan 15, 2024
0c6c456
this turns out to be unnecessary
neverRare Jan 15, 2024
1fa932c
small update
neverRare Jan 15, 2024
832bdea
allow sentences to end in semicolon
neverRare Jan 15, 2024
8b2afb2
implement comma
neverRare Jan 15, 2024
df85e2a
turns out I still need this
neverRare Jan 15, 2024
ce8f757
add todo
neverRare Jan 15, 2024
810f99b
improve la parser, avoid duplicate
neverRare Jan 15, 2024
2f7855b
implement quotation
neverRare Jan 15, 2024
60ab8e5
avoid infinite recursion
neverRare Jan 15, 2024
002b30c
small update reducing redundancies
neverRare Jan 15, 2024
ec63f3f
small update
neverRare Jan 15, 2024
32544a5
allow cardinal phrases to be modified
neverRare Jan 15, 2024
0e0c357
only allow cardinal to be more than 1 words
neverRare Jan 15, 2024
2f83ba9
use `many` in number parser
neverRare Jan 15, 2024
904e858
implement other kinds of quotation marks
neverRare Jan 16, 2024
441b583
improve error
neverRare Jan 16, 2024
486723d
implement fuzzer for phrases
neverRare Jan 16, 2024
c17fe7e
full format
neverRare Jan 16, 2024
e2570ff
allow preverbs to be nested
neverRare Jan 17, 2024
cfee834
phrases can now be prepositional
neverRare Jan 17, 2024
7db1122
implement associated predicates
neverRare Jan 17, 2024
1c75519
cleanup and fix parsers
neverRare Jan 17, 2024
45be05b
avoid infinite recursion
neverRare Jan 17, 2024
cd24e9b
fix formatting
neverRare Jan 17, 2024
b428158
implement filter for malformed pi/nanpa nesting
neverRare Jan 20, 2024
c0335c1
use filter instead
neverRare Jan 20, 2024
a3fcb2a
implement duplicate checker
neverRare Jan 20, 2024
aad5ca7
simplify modifier parser
neverRare Jan 20, 2024
83c9de1
implement "anu"
neverRare Jan 20, 2024
f214e3c
fix error
neverRare Jan 20, 2024
301d90a
add base case
neverRare Jan 20, 2024
7556b3f
fix conditional on associated predicates
neverRare Jan 20, 2024
255a817
fix conditional in nestedPhrases
neverRare Jan 20, 2024
80f8ffa
order matters
neverRare Jan 20, 2024
9dc2165
fix "anu" not parsing
neverRare Jan 20, 2024
a89c463
remove unnecessary filter
neverRare Jan 20, 2024
465bd63
hoist preposition and quotation definition as clause type
neverRare Jan 20, 2024
7aa6686
rearrange definitions
neverRare Jan 20, 2024
c727bc5
update changelog
neverRare Jan 20, 2024
3054ffc
remove discord dm as contact option
neverRare Jan 20, 2024
c389d43
make formatting more consistent
neverRare Jan 20, 2024
5bcc908
Allow associated predicates to be nested
neverRare Jan 20, 2024
380d38f
output AST count
neverRare Jan 20, 2024
f75479d
add FIXME for multiple predicate parser
neverRare Jan 20, 2024
68e8a15
add warning to documentation comments
neverRare Jan 21, 2024
b5c7629
fix multiplePredicate parser
neverRare Jan 21, 2024
e57b4d8
fix comment
neverRare Jan 21, 2024
abafe0f
add and fix comments
neverRare Jan 21, 2024
94e3072
simplify operations
neverRare Jan 21, 2024
a93ecdc
prevent infinite recursion
neverRare Jan 21, 2024
b2a6e31
implement reduplicate and restructure AST
neverRare Jan 21, 2024
36e9a3f
use all when parsing tu and wan
neverRare Jan 21, 2024
2528622
add document comments
neverRare Jan 21, 2024
b3a59ea
revert using all when parsing tu and wan
neverRare Jan 21, 2024
b3f9db3
improve reduplication parser
neverRare Jan 21, 2024
8c49daa
improve documentation
neverRare Jan 21, 2024
a0b9f6d
order matters
neverRare Jan 21, 2024
ca28c7e
nanpa particle can now be reduplicated
neverRare Jan 21, 2024
daafc15
reduplication is now non-exhaustive
neverRare Jan 21, 2024
9f93e8e
allow taso and anu seme to be reduplicated
neverRare Jan 21, 2024
088cc7c
remove comments about "a" particles
neverRare Jan 21, 2024
da37a08
rename x to value
neverRare Jan 21, 2024
921fa80
first implementation of filters
neverRare Jan 21, 2024
a680e9b
add filters for nanpa
neverRare Jan 21, 2024
f14e51d
improve error message
neverRare Jan 21, 2024
e02f4d6
apply filter for word unit
neverRare Jan 21, 2024
8d85ba1
add more rules for word unit
neverRare Jan 21, 2024
4f8fb3c
implement filter for array of modifiers
neverRare Jan 21, 2024
4253f6f
add comment
neverRare Jan 21, 2024
17e3bb4
apply filter for phrase and preposition
neverRare Jan 21, 2024
43e48bd
fix error regarding modifiers of preverb and preposition
neverRare Jan 21, 2024
f6b7fe2
disallow multiple sentences
neverRare Jan 21, 2024
2462019
disallow quotation as phrase
neverRare Jan 21, 2024
4b73a63
improve optional comma parsing for prepositions
neverRare Jan 21, 2024
811b085
fix filter
neverRare Jan 21, 2024
c714f08
Improve translation list
neverRare Jan 21, 2024
805fae6
implement filter for full clause
neverRare Jan 21, 2024
0a84cf4
implement translator for multiple sentences (sentence translator itse…
neverRare Jan 21, 2024
551bdaa
comments and exports
neverRare Jan 21, 2024
c117044
fix translation list
neverRare Jan 21, 2024
084ddc7
apply translation changes
neverRare Jan 21, 2024
e4eba16
add "pu" without translations
neverRare Jan 21, 2024
c1181ab
filter out "nanpa ala nanpa"
neverRare Jan 22, 2024
9b5fd29
implement translator for a single sentence
neverRare Jan 23, 2024
28dde3e
simplify translator functions
neverRare Jan 23, 2024
7429ebe
implement translator for clause
neverRare Jan 23, 2024
68ae263
this can be placed outside
neverRare Jan 23, 2024
2fba33a
no error idk
neverRare Jan 23, 2024
c0761a3
formatting
neverRare Jan 23, 2024
8af3384
lazy is unnecessary here
neverRare Jan 23, 2024
329b077
add todo note for avoiding duplicate
neverRare Jan 23, 2024
057b0de
add main script and add translate button
neverRare Jan 23, 2024
911dec9
restructure README.md
neverRare Jan 23, 2024
e628df2
use link to wiki
neverRare Jan 23, 2024
1222e6e
remove useless link reference
neverRare Jan 23, 2024
c956729
add CONTRIBUTING.md
neverRare Jan 23, 2024
aecf598
update style for summary
neverRare Jan 23, 2024
c124b90
add comment to old code
neverRare Jan 23, 2024
435303d
add code for bundling codes
neverRare Jan 23, 2024
f547314
add deno.js
neverRare Jan 23, 2024
911b68f
add instruction for building
neverRare Jan 23, 2024
e318323
lint
neverRare Jan 23, 2024
b7be719
add code for handling enter key
neverRare Jan 23, 2024
5c00c85
fix mistake
neverRare Jan 23, 2024
b5bf859
fix another mistake
neverRare Jan 23, 2024
ac175f8
I can't type check this for whatever reason
neverRare Jan 23, 2024
9363e19
add comment to maybe use worker
neverRare Jan 23, 2024
d44fc3e
remove Andika from style.css
neverRare Jan 23, 2024
347ba7f
update include
neverRare Jan 23, 2024
6c25ac4
prevented duplicates
neverRare Jan 23, 2024
0c1ffe6
update changelog
neverRare Jan 23, 2024
21421d5
small change
neverRare Jan 23, 2024
c8a4ec5
rename translation to definition
neverRare Jan 24, 2024
7bea2af
add TODO note for adding AST walker
neverRare Jan 24, 2024
8fca7b5
improve comments
neverRare Jan 24, 2024
e5e6a07
delete unneeded codes
neverRare Jan 24, 2024
5a8ee73
add TODO in filter
neverRare Jan 24, 2024
23ca0b0
implement walker for modifiers
neverRare Jan 24, 2024
3ae9536
remove done TODO
neverRare Jan 24, 2024
c8eb61f
disallow nested preposition
neverRare Jan 24, 2024
0af6940
remove unneeded import
neverRare Jan 24, 2024
7c0fb6c
disallow preposition in subject
neverRare Jan 24, 2024
66f6d53
actually implement clause filter
neverRare Jan 24, 2024
e29dd2b
disallow preposition in object
neverRare Jan 24, 2024
78ee759
prepare for translating phrases
neverRare Jan 24, 2024
65d90bc
small change
neverRare Jan 24, 2024
f5f323c
implement translation for compound phrases
neverRare Jan 24, 2024
347d896
implement fail safe
neverRare Jan 24, 2024
b3735b2
small change
neverRare Jan 24, 2024
01b1eed
add concat method
neverRare Jan 24, 2024
663d032
simplify function parameter
neverRare Jan 24, 2024
fdf5afc
remove unneeded filter in parser
neverRare Jan 24, 2024
8dac045
revert, this is partly needed
neverRare Jan 24, 2024
4e21c43
preparation
neverRare Jan 24, 2024
6431be0
add translator to word unit and numbers
neverRare Jan 24, 2024
f36808d
implement word unit to adjective translation
neverRare Jan 24, 2024
f768edb
avoid code duplication
neverRare Jan 24, 2024
180e836
implement ugly noun translator
neverRare Jan 24, 2024
3e872a2
change todo error
neverRare Jan 24, 2024
4b56799
fix
neverRare Jan 24, 2024
0ea2c9c
genericized translation functions
neverRare Jan 24, 2024
539a1af
allow sole phrases to be translated as adjectives
neverRare Jan 24, 2024
bf86c42
remove main.js
neverRare Jan 24, 2024
cbe0c2c
ignore main.js
neverRare Jan 24, 2024
6e4ac63
remove limitations in readme
neverRare Jan 24, 2024
741df49
implement de-duplicator
neverRare Jan 24, 2024
bd38ee9
update changelog
neverRare Jan 24, 2024
152b31d
update changelog
neverRare Jan 24, 2024
b8ceca3
update changelog
neverRare Jan 24, 2024
308073e
fix
neverRare Jan 24, 2024
b61f7c6
remove unneeded test script
neverRare Jan 24, 2024
5de07cf
Create deno.yml
neverRare Jan 24, 2024
573ff38
release
neverRare Jan 24, 2024
4741680
Merge branch 'master' of https://github.com/neverRare/toki-pona-trans…
neverRare Jan 24, 2024
95889f5
update copyright year
neverRare Jan 24, 2024
3bdee9b
Merge pull request #9 from neverRare/release
neverRare Jan 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow will install Deno then run `deno lint` and `deno test`.
# For more information see: https://github.com/denoland/setup-deno

name: Deno

on:
push:
branches: ["release"]
pull_request:
branches: ["release"]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Setup repo
uses: actions/checkout@v3

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Build
run: deno task build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main.js
17 changes: 9 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"cSpell.customDictionaries": {
"ku-suli": {
"name": "ku-suli",
"path": "${workspaceRoot}/nimi-ku-suli.txt",
"description": "Ku Suli words of Toki Pona",
"addWords": true
}
"cSpell.customDictionaries": {
"ku-suli": {
"name": "ku-suli",
"path": "${workspaceRoot}/nimi-ku-suli.txt",
"description": "Ku Suli words of Toki Pona",
"addWords": true
}
}
},
"deno.enable": true
}
31 changes: 28 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
# Changelog

## 0.2.0

For this version. The whole code has been rewritten. The translator can now translate few more things! Although it's still not capable of translating full sentences.

- Implement translator for:
- Extended numbering system
- Reduplication
- _nanpa_ particle
- _en_ and _anu_
- Add button for translating, replacing auto-translate when typing.
- (Downgrade) Drop support for "a" particle.
- (Downgrade) Error messages are now very unreliable.
- (Downgrade) Translator is somewhat slower.
- Remove Discord DM as contact option.
- Update translation list:
- _tonsi_ – change nouns "transgender", "transgenders", "non-binary", and "non-binaries" into "transgender person", "transgender people", "non-binary person", and "non-binary people" (I DIDN'T MEAN TO OBJECTIFY THEM OMFG I'M SO SORRY 😭😭😭)

Inside update (intended for developers):

- Rewritten whole code to use TypeScript, module, and functional programming.
- Rewritten parser to use parser combinator.
- Add language codes to html.
- New wiki for contributors and thinkerers.
- Overhaul `README.md`, only including build instruction. Information about the translator is now moved to wiki.

## 0.1.1

- Update copyright notice
- Update version number on the page
- Update contacts to discord (from `neverRare#1517` to `never_rare`)
- Update copyright notice.
- Update version number on the page.
- Update contacts to Discord. (from `neverRare#1517` to `never_rare`)

## 0.1.0

Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Contributing

You can do the usual github stuff: Open issue if there's an issue or you have a suggestion; Open pull request if you want to propose changes. If you want to propose a large change however, please open an issue first (or comment on an already existing issue page), and wait for my signal before beginning to work.

## The wiki

The wiki provides useful information for contributors, although it's not complete yet. Check it out: [Visit wiki](https://github.com/neverRare/toki-pona-translator/wiki).
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 neverRare
Copyright (c) 2024 neverRare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
67 changes: 9 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,16 @@ An imperfect Toki Pona to English translator that translates into multiple sente

[Try it](https://neverrare.github.io/toki-pona-translator/)

## Goals
## Building

The goals for this projects are:
You'll need [Deno](https://deno.com/). Run the following command.

- Provide translation that covers most of semantics and meaning of a Toki Pona sentence, but it doesn't have to be complete. This gives translations for users to scan into to give them a feel of how broad a Toki Pona sentence can mean.
- As much as possible, provide translations that are grammatically sound: not just correct but also feels right. For example, "red one thing" sounds off than "one red thing". Due to the difference of English and Toki Pona and nuances of English, the translator may fall severely short for this goal, but we can try!
```
git clone https://github.com/neverRare/toki-pona-translator.git
cd toki-pona-translator
deno task build
```

## Non-goals
Then open `./index.html` using your favorite browser.

- Provide every possible translations.
- Handle every edge cases of Toki Pona grammar. Some edge cases are listed in [limitations] along with others.
- Handle compounds such as translating "tomo tawa" into "vehicle"
- Translate Tokiponized proper word into what it was before such as translating "Manka" into "Minecraft"

Some of these may be lifted in the future.

## Terminology

These are the terminology used in [limitations]

- Headword – A single part of speech that in English, can be a noun, a verb, or an adjective; what the phrase starts with.
- Modifier – A part of speech that modifies headword or another modifier.
- Phrase – Headword and its modifiers.
- Clause – A part of sentence without "la" particle, "taso" particle in the beginning, "a" particles in the beginning and the end; found before and after "la", or the sentence itself without particles around it if it doesn't have "la".
- Proper Word – Proper name; Capitalized in Toki Pona.

## Limitations

[limitations]: #limitations

The following are currently unrecognized (non-definitive but pedantic).

- Full sentences: It can only translate phrases for now. The following limitations pretends the translator can translate full sentences, this is because these are planned limitations.
- Non-pu vocabulary with exception to "pu" ("tonsi" is included in the vocabulary)
- Multiple sentences
- Comma as sentence separator (commas are treated as decoration and ignored)
- Proper word as headword
- Having multiple consecutive "a"s inside a sentence (in the beginning or end is fine)
- "taso" as headword ("taso" is currently recognized as modifier or particle at the beginning of a sentence)
- Having no clause before or after "la" particle
- "mi/sina li (pred)" constructions
- "mi/sina (pred) li (pred)" constructions (this would be recognized as "mi (modifier) li (pred)")
- "mi/sina a (pred)" constructions
- Clause with both "li" and "o"
- Clause with multiple "o"s
- Clause with "en" but without predicate ("li" or "o")
- "nanpa" as ordinal particle
- Extended numbering system
- "kepeken" as headword or modifier
- Multiple "pi" on a phrase
- "pi" followed by at most one modifier
- Multiple separate proper word on a single phrase, unless they're separated by "pi" (Proper words spanning multiple words like "musi Manka Sawa" is fine, this limitation refers to something like "musi Manka pona Sawa"; something like "musi Manka pi kule Sawa" is fine)
- proper word followed by "pi"
- "anu" particle
- "la a"
- "en a"
- "li a"
- "o a"
- "e a"
- "pi a"

Some of these may be lifted in the future.
Whenever you made changes to `./src/*.ts`, you'll need to run `deno task build` again and refresh the browser. Later I'll make a script to automate this.
10 changes: 10 additions & 0 deletions bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { bundle } from "https://deno.land/x/[email protected]/mod.ts";

const SOURCE = "./src/main.ts";
const DESTINATION = "./main.js";

const url = new URL(SOURCE, import.meta.url);
const result = await bundle(url);

const { code } = result;
await Deno.writeTextFile(DESTINATION, code);
16 changes: 16 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"lock": false,
"compilerOptions": {
"target": "esnext",
"lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"]
},
"tasks": {
"build": "deno run --allow-read --allow-write --allow-env ./bundle.ts"
},
"fmt": {
"include": ["./src/**/*.ts", "./bundle.ts", "./test-parser.ts"]
},
"lint": {
"include": ["./src/**/*.ts", "./bundle.ts", "./test-parser.ts"]
}
}
15 changes: 9 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="author" content="neverRare" />
Expand All @@ -24,11 +24,15 @@ <h1>Toki Pona Translator</h1>
<p>
An imperfect Toki Pona to English translator that translates into multiple
sentences.
<a href="https://github.com/neverRare/toki-pona-translator#limitations"
<a
href="https://github.com/neverRare/toki-pona-translator/wiki/Limitations"
>Limitations</a
>.
</p>
<textarea id="input" placeholder="o toki tawa ni"></textarea>
<textarea id="input" placeholder="o toki tawa ni" lang="tok"></textarea>
<div>
<button id="translate-button">Translate</button>
</div>
<ul id="output"></ul>
<p id="error"></p>
<details>
Expand All @@ -51,7 +55,6 @@ <h1>Toki Pona Translator</h1>
>Toki Pona to multiple English sentence translator</a
>.
</li>
<li>Dm me on Discord: never_rare</li>
<li>
Email me:
<a href="mailto:[email protected]"
Expand All @@ -63,8 +66,8 @@ <h1>Toki Pona Translator</h1>
<footer>
<p>
<a
href="https://github.com/neverRare/toki-pona-translator/blob/master/CHANGELOG.md#002"
>v0.1.1</a
href="https://github.com/neverRare/toki-pona-translator/blob/master/CHANGELOG.md"
>v0.2.0</a
>
- &copy; 2024 neverRare -
<a
Expand Down
Loading
Loading