Sonagi is a Swift app that parses Korean sentences and shows definitions for each morpheme or word. The parsing algorithm is based on Open Korean Text Processor and is accessed via KoNLPy, a Python package for Korean NLP. Definitions are based on kengdic by Joseph Speigle; kengdic
is hosted by garfieldnate and is released under MPL 2.0.
- Install Cocoapods if not already installed
- Run
pod install
in the folderDependencies
- Launch
Sonagi.xcworkspace
- This app requires Python 3.6/2.7. The Python script embedded in this app,
KoNLPyParser.py
, for interfacing with KoNLPy assumes you have a Python installation at/usr/bin/local/python
, which is the default installation from Homebrew. If you have a Python distribution from Anaconda etc., you may change the first line in the Python script to the path of the Python binary you prefer to use- If you are unsure what Python installation you have, run
which python
in terminal. If the output is/usr/bin/python
, then macOS' system Python version is the default and is not recommended unless you are confident/have prior experience in using it. It is recommended to use Homebrew/Anaconda to avoid interacting with the system's Python distribution and avoid having to usesudo
for installing Python packages
- If you are unsure what Python installation you have, run
- Install the
KoNLPy
package via Pip. Make sure you can successfully importKoNLPy
(import konlpy
), the first line ofKoNLPyParser.py
matches your preferred Python distribution and is the distribution that has theKoNLPy
package installed. - Build
- The app is confirmed to run on macOS 10.14.3 (macOS Mojave)
- If users have Nanum Square Regular, available via Naver, installed, the app will use that font. Otherwise it will opt for the System font.
- Copy some Korean text and Sonagi will present the parsed text, color-coded by part of speech.
- Hover over individual words or morphemes and see the definition
- Sonagi will detect if the user's clipboard has changed when the user switches back to the app and will update the displayed text accordingly.
- Implement history
- Clean up definitions before presenting, e.g., spacing, abbreviations
- Add filter for Korean text
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- KoNLPy (0.5.1)
- Open Korean Text Processor (2.1.0 according to KoNLPy)
- SQLite.swift (0.11.5)
- kengdic
- The SQL file for
kengdic
used in Sonagi can found in this repository here
- The SQL file for