Korean josa (조사, particles) for Dart and Flutter. Give it a particle and a word, and it attaches the form that fits the word's last syllable (받침): 간장을, 시계를, 사과는, 건물로.
No dependencies. It runs anywhere Dart runs: Flutter on iOS, Android, web and desktop, servers, and the command line.
dart pub add josa # or: flutter pub add josaimport 'package:josa/josa.dart';
Josa.of('을/를').of('간장'); // 간장을
Josa.of('을/를').of('시계'); // 시계를
Josa.of('으로/로').of('건물'); // 건물로 (a word ending in ㄹ takes 로)Any form of a particle works as the key. '을', '를' and '을/를' are the same:
Josa.of('를').of('간장'); // 간장을To get only the particle, pass withValue: false:
Josa.of('이/가', withValue: false).of('나무'); // 가In a Flutter widget, with a name that comes from data:
Text('${Josa.of('이/가').of(name)} 도착했습니다') // 민준이 도착했습니다 / 지우가 도착했습니다| Particle | After a final consonant | After a vowel |
|---|---|---|
| 을/를 | 책을 | 사과를 |
| 은/는 | 책은 | 사과는 |
| 이/가 | 책이 | 사과가 |
| 와/과 | 책과 | 사과와 |
| 이여/여 | 조국이여 | 친구여 |
| 으로/로 | 책으로 | 사과로, 건물로 (ㄹ) |
| 이에요/예요 | 책이에요 | 사과예요 |
| 이었/였 | 학생이었 | 의사였 |
| 아/야 | 영숙아 | 철수야 |
Most Korean particles have two forms: one after a final consonant (받침) and one after a vowel. josa reads the last Hangul syllable of the word and picks the form. 으로/로 is the exception: a word ending in ㄹ takes 로, like a vowel.
The word has to end in a Hangul syllable. Numbers and Latin letters (3,
API) are read aloud differently by different people, so pass the Korean
reading instead (삼, 에이피아이).
단어의 마지막 글자 받침을 보고 을/를, 은/는, 이/가, 와/과, 으로/로 같은 조사를 알맞게 붙여 주는 Dart·Flutter 라이브러리입니다. 사용자 이름이나 상품명처럼 값이 바뀌는 단어 뒤에 조사를 붙일 때 씁니다. 의존성이 없어서 Flutter 앱, 서버, 명령줄 어디서나 동작합니다.
Josa.of('을/를').of(상품명); // 사과를, 수박을