Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

Commit a5c8691

Browse files
committed
Update Readme
1 parent cd7a160 commit a5c8691

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

README.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Konglog: Write your favorite Konglish correctly with Prolog
22

3-
Final Project for CS579 Computational Linguistics, Fall 2021
3+
Final Project for CS579 Computational Linguistics at KAIST, Fall 2021, by Janggun Lee.
44

55
## Introduction:
6-
<!-- TODO -->
6+
Konglog is an implementation of the [Korean Loanword Orthography](https://kornorms.korean.go.kr/m/m_regltn.do#a) in Prolog and Python. It aims to faifully encode the rules of the orthography, and provide a simple API for all to use.
77

88
## Dependencies:
99

@@ -20,7 +20,7 @@ Final Project for CS579 Computational Linguistics, Fall 2021
2020
### NLTK
2121

2222
* Install [NLTK](https://www.nltk.org/install.html).
23-
* Download the `cmudict` corpus. Run the following simple script. This will download only the nessecary data.
23+
* Download the `cmudict` corpus, and run the following Python script. This will download only the nessecary data.
2424

2525
```python
2626
import nltk
@@ -29,7 +29,21 @@ nltk.download('cmudict')
2929
* If the download doesn't start with `[SSL:CERTIFICATE_VERIFY_FAILED]`, check [this comment](https://github.com/gunthercox/ChatterBot/issues/930#issuecomment-322111087) for a solution.
3030

3131
## API:
32-
<!-- TODO -->
32+
Konglog provides a simple function, `eng_to_kong` that takes in a english word as input, and returns the Konglish translation as output. A very simple example is shown below.
33+
34+
```python
35+
import konglog
36+
37+
def main():
38+
word = "shrimp"
39+
40+
print(konglog.eng_to_kong(word))
41+
```
3342

3443
## Structure:
35-
<!-- TODO -->
44+
Konglog has three main steps in its architecture, depicted in the picture below.
45+
![Architecture](architecture.png)
46+
47+
1. First, the input word is translated into phonems by looking up the CMU pronounciation dictionary, provided by NLTK.
48+
2. Second, the phonems are trasnalted into jaem and moems.
49+
3. Finally, the jaem and moems are combined into one. The tools for this combination are in [unicode.py](unicode.py), and is taken from [`hangulutils`](https://github.com/kaniblu/hangul-utils)

architecture.png

78.6 KB
Loading

konglog.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ def eng_to_kong(eng_word: str)-> list[str]:
99
not have unique results, the result will be a list.
1010
For example, "hello" will be translated into [허로, 헐로]
1111
12+
# Panics
13+
When given a english word that it cannot translate, `eng_to_kong` will raise an Not_found exception.
14+
1215
Example
1316
```python
1417
import konglog
1518
1619
def main():
17-
word = "hello"
18-
19-
kong_words = konglog.eng_to_kong(word)
20+
word = "shrimp"
2021
21-
for kong in kong_words:
22-
print(kong)
22+
print(konglog.eng_to_kong(word))
2323
```
2424
"""
2525

@@ -42,7 +42,7 @@ def main():
4242
for jls in prolog_res:
4343
temp = jls['X']
4444
temp.reverse()
45-
jamo_lists.append(temp)
45+
4646
jamo_all = []
4747
for jamo_list in jamo_lists:
4848
temp_jamo_all = [""]

0 commit comments

Comments
 (0)