├── .all-contributorsrc ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── assets │ └── search_address.csv ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── correct_postpositions_page.dart │ ├── eng_to_kor_page.dart │ ├── explode_page.dart │ ├── implode_page.dart │ ├── kor_to_eng_page.dart │ ├── main.dart │ ├── reg_exp_page.dart │ └── reg_exp_text_field.dart ├── macos │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ │ ├── Base.lproj │ │ └── MainMenu.xib │ │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── lib ├── korea_regexp.dart └── src │ ├── constant.dart │ ├── correct_postpositions.dart │ ├── eng_to_kor.dart │ ├── escape_regexp.dart │ ├── explode.dart │ ├── get_phonemes.dart │ ├── get_regexp.dart │ ├── implode.dart │ ├── kor_to_eng.dart │ └── models │ ├── phonemes_result.dart │ └── regexp_options.dart ├── pubspec.lock ├── pubspec.yaml └── test ├── correct_postpositions_test.dart ├── eng_to_kor_test.dart ├── explode_test.dart ├── get_phonemes_test.dart ├── get_reg_exp_test.dart ├── implode_test.dart ├── kor_to_eng_test.dart └── korea_regexp_test.dart /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "jpoh281", 10 | "name": "홍종표", 11 | "avatar_url": "https://avatars.githubusercontent.com/u/54665433?v=4", 12 | "profile": "https://honor-driven.dev/", 13 | "contributions": [ 14 | "code", 15 | "doc", 16 | "test", 17 | "ideas", 18 | "maintenance" 19 | ] 20 | }, 21 | { 22 | "login": "viiviii", 23 | "name": "viiviii", 24 | "avatar_url": "https://avatars.githubusercontent.com/u/75404713?v=4", 25 | "profile": "https://velog.io/@viiviii", 26 | "contributions": [ 27 | "code", 28 | "test", 29 | "ideas" 30 | ] 31 | }, 32 | { 33 | "login": "jiwon79", 34 | "name": "Lee Jiwon", 35 | "avatar_url": "https://avatars.githubusercontent.com/u/59159410?v=4", 36 | "profile": "https://linktr.ee/jiiwon79", 37 | "contributions": [ 38 | "bug" 39 | ] 40 | }, 41 | { 42 | "login": "BottlePumpkin", 43 | "name": "BottlePumpkin", 44 | "avatar_url": "https://avatars.githubusercontent.com/u/61003485?v=4", 45 | "profile": "https://github.com/BottlePumpkin", 46 | "contributions": [ 47 | "bug" 48 | ] 49 | } 50 | ], 51 | "contributorsPerLine": 7, 52 | "projectName": "flutter_korea_regexp", 53 | "projectOwner": "jpoh281", 54 | "repoType": "github", 55 | "repoHost": "https://github.com", 56 | "skipCi": true, 57 | "commitConvention": "angular", 58 | "commitType": "docs" 59 | } 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/ephemeral 64 | **/ios/Flutter/app.flx 65 | **/ios/Flutter/app.zip 66 | **/ios/Flutter/flutter_assets/ 67 | **/ios/Flutter/flutter_export_environment.sh 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: d79295af24c3ed621c33713ecda14ad196fd9c31 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.2.1 2 | - README.md 파일 수정 3 | 4 | ## 1.2.0 5 | - empty string('') 입력 시 에러를 반환하지 않도록 수정 6 | - empty string('') 입력 시 전체 매치 여부 옵션 추가 7 | 8 | ## 1.1.0 9 | - 최소 버전 dart 3.0 변경 10 | - 초성을 검색할 때 해당 초성도 찾도록 수정 11 | - nonCapturedGroup 조건 추가 12 | 13 | ## 1.0.1 14 | - dart lint 일부 수정 15 | - lints, test 패키지 업그레이드 16 | - example 프로젝트 android 13 마이그레이션 17 | 18 | ## 1.0.0+1 19 | - 3.7.0 마이그레이션 20 | 21 | ## 0.2.0+3 22 | - 라이센스 수정 23 | 24 | ## 0.2.0+2 25 | - 라이센스 수정 26 | 27 | ## 0.2.0+1 28 | - Explode에서 모음을 정상적으로 분리하지 못하는 현상 수정 29 | 30 | ## 0.1.0+1 31 | - Flutter Only에서 Dart, Flutter 둘 다 사용할 수 있도록 변경 32 | 33 | ## 0.1.0 34 | - 기존 ts 패키지에 있었던 기능을 전부 dart 언어로 구현 35 | - README.md 오타 수정 및 GIF 이미지 순서 변경 36 | - CHANGELOG.md 파일 실수 수정 37 | 38 | ## 0.0.2 39 | - README.md 파일 수정 40 | 41 | ## 0.0.1 42 | - 🎉 Initial Version 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 홍종표 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # korea_regexp 2 | 3 | [![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-) 4 | 5 | 6 | https://github.com/bluewings/korean-regexp 7 | 8 | 해당 깃허브를 보고 자바스크립트로 구현된 한글 정규표현식 패키지를 다트로 변경한 플러그인입니다. 9 | 10 | ## 현재 구현된 기능 11 | - [x] 한글 자동완성을 위한 정규식 12 | - [x] 영타 -> 한타 13 | - [x] 한타 -> 영타 14 | - [x] 조사 자동 치환 15 | - [x] 자소 분리 16 | - [x] 자소 합치기 17 | 18 | 19 | ## 기능 설명 20 | 21 | ### 한글 자동완성을 위한 정규식 22 | ![KakaoTalk_Photo_2021-11-01-23-59-33](https://user-images.githubusercontent.com/54665433/139692643-126e799b-a38a-482c-ae41-8a1609e85e07.gif) 23 | - initial search : 초성으로 검색 여부 24 | ex) ㄱㅇㄷ -> 강원도 25 | 26 | - startsWith: 시작과 일치 (default : false) 27 | 28 | - endsWith: 마지막과 일치 (default : false) 29 | 30 | - ignoreSpace: 공백 무시 (default : false) 31 | 32 | - ignoreCase: 대소문자 무시 (default : false) 33 | 34 | - fuzzy: (default : false) 35 | 36 | - nonCapturingGroup: (default : false) 37 | 38 | - emptyMatchAll: empty string('') 입력 시 전체 매치 여부 (default : false) 39 | 40 | ### 한타 -> 영타 41 | ![KakaoTalk_Photo_2021-11-01-23-58-35](https://user-images.githubusercontent.com/54665433/139692493-245f66f1-5b30-4152-af0b-2f25d3d85c6f.gif) 42 | 43 | ### 영타 -> 한타 44 | ![KakaoTalk_Photo_2022-03-21-23-08-40](https://user-images.githubusercontent.com/54665433/159278819-dc296220-d218-482d-a6ed-3ffb2f99c30c.gif) 45 | 46 | ### 자소 분리 47 | ![KakaoTalk_Photo_2021-11-01-23-56-29](https://user-images.githubusercontent.com/54665433/139692340-ff124f09-bd2f-4ca4-ac8b-df1f39fb27d4.gif) 48 | 49 | ### 자소 합치기 50 | ![KakaoTalk_Photo_2022-03-21-22-22-02](https://user-images.githubusercontent.com/54665433/159269633-041e3457-3fc3-4920-9945-348286eb3162.gif) 51 | 52 | ### 조사 자동 치환 53 | ![KakaoTalk_Photo_2022-03-11-00-13-48](https://user-images.githubusercontent.com/54665433/157692127-39c438cb-6241-4c0f-962a-e5bf1517663a.gif) 54 | 55 | 56 | ## Contributors ✨ 57 | ### Issue, PR 언제나 환영입니다. 58 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
홍종표
홍종표

💻 📖 ⚠️ 🤔 🚧
viiviii
viiviii

💻 ⚠️ 🤔
Lee Jiwon
Lee Jiwon

🐛
BottlePumpkin
BottlePumpkin

🐛
73 | 74 | 75 | 76 | 77 | 78 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 79 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:lints/recommended.yaml -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: d79295af24c3ed621c33713ecda14ad196fd9c31 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 33 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.example" 38 | minSdkVersion 16 39 | targetSdkVersion 33 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 14 | 18 | 22 | 27 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.20' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | tasks.register("clean", Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1430; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | alwaysOutOfDate = 1; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | ); 178 | inputPaths = ( 179 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 180 | ); 181 | name = "Thin Binary"; 182 | outputPaths = ( 183 | ); 184 | runOnlyForDeploymentPostprocessing = 0; 185 | shellPath = /bin/sh; 186 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 187 | }; 188 | 9740EEB61CF901F6004384FC /* Run Script */ = { 189 | isa = PBXShellScriptBuildPhase; 190 | alwaysOutOfDate = 1; 191 | buildActionMask = 2147483647; 192 | files = ( 193 | ); 194 | inputPaths = ( 195 | ); 196 | name = "Run Script"; 197 | outputPaths = ( 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | shellPath = /bin/sh; 201 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 202 | }; 203 | /* End PBXShellScriptBuildPhase section */ 204 | 205 | /* Begin PBXSourcesBuildPhase section */ 206 | 97C146EA1CF9000F007C117D /* Sources */ = { 207 | isa = PBXSourcesBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 211 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXSourcesBuildPhase section */ 216 | 217 | /* Begin PBXVariantGroup section */ 218 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 219 | isa = PBXVariantGroup; 220 | children = ( 221 | 97C146FB1CF9000F007C117D /* Base */, 222 | ); 223 | name = Main.storyboard; 224 | sourceTree = ""; 225 | }; 226 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 227 | isa = PBXVariantGroup; 228 | children = ( 229 | 97C147001CF9000F007C117D /* Base */, 230 | ); 231 | name = LaunchScreen.storyboard; 232 | sourceTree = ""; 233 | }; 234 | /* End PBXVariantGroup section */ 235 | 236 | /* Begin XCBuildConfiguration section */ 237 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_ANALYZER_NONNULL = YES; 242 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 243 | CLANG_CXX_LIBRARY = "libc++"; 244 | CLANG_ENABLE_MODULES = YES; 245 | CLANG_ENABLE_OBJC_ARC = YES; 246 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 247 | CLANG_WARN_BOOL_CONVERSION = YES; 248 | CLANG_WARN_COMMA = YES; 249 | CLANG_WARN_CONSTANT_CONVERSION = YES; 250 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 251 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 252 | CLANG_WARN_EMPTY_BODY = YES; 253 | CLANG_WARN_ENUM_CONVERSION = YES; 254 | CLANG_WARN_INFINITE_RECURSION = YES; 255 | CLANG_WARN_INT_CONVERSION = YES; 256 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 257 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 258 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 261 | CLANG_WARN_STRICT_PROTOTYPES = YES; 262 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 263 | CLANG_WARN_UNREACHABLE_CODE = YES; 264 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 265 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 266 | COPY_PHASE_STRIP = NO; 267 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 268 | ENABLE_NS_ASSERTIONS = NO; 269 | ENABLE_STRICT_OBJC_MSGSEND = YES; 270 | GCC_C_LANGUAGE_STANDARD = gnu99; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 274 | GCC_WARN_UNDECLARED_SELECTOR = YES; 275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 276 | GCC_WARN_UNUSED_FUNCTION = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 279 | MTL_ENABLE_DEBUG_INFO = NO; 280 | SDKROOT = iphoneos; 281 | SUPPORTED_PLATFORMS = iphoneos; 282 | TARGETED_DEVICE_FAMILY = "1,2"; 283 | VALIDATE_PRODUCT = YES; 284 | }; 285 | name = Profile; 286 | }; 287 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 288 | isa = XCBuildConfiguration; 289 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 290 | buildSettings = { 291 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 292 | CLANG_ENABLE_MODULES = YES; 293 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 294 | DEVELOPMENT_TEAM = ""; 295 | ENABLE_BITCODE = NO; 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = ( 298 | "$(inherited)", 299 | "@executable_path/Frameworks", 300 | ); 301 | PRODUCT_BUNDLE_IDENTIFIER = com.example.koreaRegexp; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 304 | SWIFT_VERSION = 5.0; 305 | VERSIONING_SYSTEM = "apple-generic"; 306 | }; 307 | name = Profile; 308 | }; 309 | 97C147031CF9000F007C117D /* Debug */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ALWAYS_SEARCH_USER_PATHS = NO; 313 | CLANG_ANALYZER_NONNULL = YES; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 319 | CLANG_WARN_BOOL_CONVERSION = YES; 320 | CLANG_WARN_COMMA = YES; 321 | CLANG_WARN_CONSTANT_CONVERSION = YES; 322 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 324 | CLANG_WARN_EMPTY_BODY = YES; 325 | CLANG_WARN_ENUM_CONVERSION = YES; 326 | CLANG_WARN_INFINITE_RECURSION = YES; 327 | CLANG_WARN_INT_CONVERSION = YES; 328 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 329 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 330 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 331 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 332 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 333 | CLANG_WARN_STRICT_PROTOTYPES = YES; 334 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 335 | CLANG_WARN_UNREACHABLE_CODE = YES; 336 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 337 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 338 | COPY_PHASE_STRIP = NO; 339 | DEBUG_INFORMATION_FORMAT = dwarf; 340 | ENABLE_STRICT_OBJC_MSGSEND = YES; 341 | ENABLE_TESTABILITY = YES; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_DYNAMIC_NO_PIC = NO; 344 | GCC_NO_COMMON_BLOCKS = YES; 345 | GCC_OPTIMIZATION_LEVEL = 0; 346 | GCC_PREPROCESSOR_DEFINITIONS = ( 347 | "DEBUG=1", 348 | "$(inherited)", 349 | ); 350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 352 | GCC_WARN_UNDECLARED_SELECTOR = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 354 | GCC_WARN_UNUSED_FUNCTION = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 357 | MTL_ENABLE_DEBUG_INFO = YES; 358 | ONLY_ACTIVE_ARCH = YES; 359 | SDKROOT = iphoneos; 360 | TARGETED_DEVICE_FAMILY = "1,2"; 361 | }; 362 | name = Debug; 363 | }; 364 | 97C147041CF9000F007C117D /* Release */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ALWAYS_SEARCH_USER_PATHS = NO; 368 | CLANG_ANALYZER_NONNULL = YES; 369 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 370 | CLANG_CXX_LIBRARY = "libc++"; 371 | CLANG_ENABLE_MODULES = YES; 372 | CLANG_ENABLE_OBJC_ARC = YES; 373 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 374 | CLANG_WARN_BOOL_CONVERSION = YES; 375 | CLANG_WARN_COMMA = YES; 376 | CLANG_WARN_CONSTANT_CONVERSION = YES; 377 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 378 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 379 | CLANG_WARN_EMPTY_BODY = YES; 380 | CLANG_WARN_ENUM_CONVERSION = YES; 381 | CLANG_WARN_INFINITE_RECURSION = YES; 382 | CLANG_WARN_INT_CONVERSION = YES; 383 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 384 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 385 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 387 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 388 | CLANG_WARN_STRICT_PROTOTYPES = YES; 389 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 390 | CLANG_WARN_UNREACHABLE_CODE = YES; 391 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 392 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 393 | COPY_PHASE_STRIP = NO; 394 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 395 | ENABLE_NS_ASSERTIONS = NO; 396 | ENABLE_STRICT_OBJC_MSGSEND = YES; 397 | GCC_C_LANGUAGE_STANDARD = gnu99; 398 | GCC_NO_COMMON_BLOCKS = YES; 399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 401 | GCC_WARN_UNDECLARED_SELECTOR = YES; 402 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 403 | GCC_WARN_UNUSED_FUNCTION = YES; 404 | GCC_WARN_UNUSED_VARIABLE = YES; 405 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 406 | MTL_ENABLE_DEBUG_INFO = NO; 407 | SDKROOT = iphoneos; 408 | SUPPORTED_PLATFORMS = iphoneos; 409 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 410 | TARGETED_DEVICE_FAMILY = "1,2"; 411 | VALIDATE_PRODUCT = YES; 412 | }; 413 | name = Release; 414 | }; 415 | 97C147061CF9000F007C117D /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 418 | buildSettings = { 419 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 420 | CLANG_ENABLE_MODULES = YES; 421 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 422 | DEVELOPMENT_TEAM = ""; 423 | ENABLE_BITCODE = NO; 424 | INFOPLIST_FILE = Runner/Info.plist; 425 | LD_RUNPATH_SEARCH_PATHS = ( 426 | "$(inherited)", 427 | "@executable_path/Frameworks", 428 | ); 429 | PRODUCT_BUNDLE_IDENTIFIER = com.example.koreaRegexp; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 432 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 433 | SWIFT_VERSION = 5.0; 434 | VERSIONING_SYSTEM = "apple-generic"; 435 | }; 436 | name = Debug; 437 | }; 438 | 97C147071CF9000F007C117D /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 441 | buildSettings = { 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | CLANG_ENABLE_MODULES = YES; 444 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 445 | DEVELOPMENT_TEAM = ""; 446 | ENABLE_BITCODE = NO; 447 | INFOPLIST_FILE = Runner/Info.plist; 448 | LD_RUNPATH_SEARCH_PATHS = ( 449 | "$(inherited)", 450 | "@executable_path/Frameworks", 451 | ); 452 | PRODUCT_BUNDLE_IDENTIFIER = com.example.koreaRegexp; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 455 | SWIFT_VERSION = 5.0; 456 | VERSIONING_SYSTEM = "apple-generic"; 457 | }; 458 | name = Release; 459 | }; 460 | /* End XCBuildConfiguration section */ 461 | 462 | /* Begin XCConfigurationList section */ 463 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 464 | isa = XCConfigurationList; 465 | buildConfigurations = ( 466 | 97C147031CF9000F007C117D /* Debug */, 467 | 97C147041CF9000F007C117D /* Release */, 468 | 249021D3217E4FDB00AE95B9 /* Profile */, 469 | ); 470 | defaultConfigurationIsVisible = 0; 471 | defaultConfigurationName = Release; 472 | }; 473 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 474 | isa = XCConfigurationList; 475 | buildConfigurations = ( 476 | 97C147061CF9000F007C117D /* Debug */, 477 | 97C147071CF9000F007C117D /* Release */, 478 | 249021D4217E4FDB00AE95B9 /* Profile */, 479 | ); 480 | defaultConfigurationIsVisible = 0; 481 | defaultConfigurationName = Release; 482 | }; 483 | /* End XCConfigurationList section */ 484 | }; 485 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 486 | } 487 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UIApplicationSupportsIndirectInputEvents 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/correct_postpositions_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:korea_regexp/korea_regexp.dart'; 5 | 6 | const kExampleText = [ 7 | '전쟁와(과) 평화', 8 | '죄와(과) 벌', 9 | '설탕은(는) 달다', 10 | '고양이은(는) 건드리지 마라', 11 | '홍길동이(가) 홍상직을(를) 만났다', 12 | '토끼 이(가) 거북이을(를) 만났다', 13 | '''"토끼"이(가) '거북이'을(를) 만났다''', 14 | '고양이은(는) 건드리지 마라' 15 | ]; 16 | 17 | class CorrectPostPositionsPage extends StatefulWidget { 18 | const CorrectPostPositionsPage({Key? key}) : super(key: key); 19 | 20 | @override 21 | _CorrectPostPositionsPageState createState() => 22 | _CorrectPostPositionsPageState(); 23 | } 24 | 25 | class _CorrectPostPositionsPageState extends State { 26 | late TextEditingController controller; 27 | late dynamic text = ''; 28 | 29 | @override 30 | void initState() { 31 | super.initState(); 32 | controller = TextEditingController(text: kExampleText[Random().nextInt(8)]); 33 | } 34 | 35 | @override 36 | void dispose() { 37 | super.dispose(); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | appBar: AppBar( 44 | title: Text("조사 자동 치환"), 45 | ), 46 | body: SingleChildScrollView( 47 | child: Padding( 48 | padding: const EdgeInsets.all(8.0), 49 | child: Column( 50 | children: [ 51 | Row( 52 | children: [ 53 | Expanded( 54 | child: TextField( 55 | controller: controller, 56 | )), 57 | OutlinedButton( 58 | onPressed: () { 59 | setState(() { 60 | text = correctPostpositions(controller.text); 61 | }); 62 | }, 63 | child: Text("변환"),), 64 | ], 65 | ), 66 | OutlinedButton( 67 | onPressed: () { 68 | setState(() { 69 | controller.text = kExampleText[Random().nextInt(7)]; 70 | print(Random().nextInt(7)); 71 | }); 72 | }, 73 | child: Text("랜덤 예시 불러오기"),), 74 | Text("1. 조사 A(B)형태로 적어주세요. 예시: 은(는), 이(가)"), 75 | Text("2. 명사 뒤에 작은 따옴표, 큰 따옴표, 공백 한칸은 올 수 있습니다.",), 76 | Text('''예시: "'토끼'",""거북이"","고양이 "''',), 77 | Text( 78 | text.toString(), 79 | style: TextStyle(color: Colors.redAccent, fontSize: 20), 80 | ), 81 | ], 82 | ), 83 | ), 84 | ), 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /example/lib/eng_to_kor_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:korea_regexp/korea_regexp.dart'; 3 | 4 | class EngToKorPage extends StatefulWidget { 5 | const EngToKorPage({Key? key}) : super(key: key); 6 | 7 | @override 8 | _EngToKorPageState createState() => _EngToKorPageState(); 9 | } 10 | 11 | class _EngToKorPageState extends State { 12 | late TextEditingController controller; 13 | var text = ''; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | controller = TextEditingController(text: 'Rkrenrldhk xhdekfr!'); 19 | } 20 | 21 | @override 22 | void dispose() { 23 | controller.dispose(); 24 | super.dispose(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar( 31 | title: Text('영어 -> 한글 테스트'), 32 | ), 33 | body: SingleChildScrollView( 34 | child: Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: Column( 37 | children: [ 38 | Row( 39 | children: [ 40 | Expanded( 41 | child: TextField( 42 | controller: controller, 43 | ), 44 | ), 45 | OutlinedButton( 46 | onPressed: () { 47 | setState(() { 48 | text = engToKor(controller.text); 49 | }); 50 | }, 51 | child: Text('변환'), 52 | ), 53 | ], 54 | ), 55 | Text( 56 | text, 57 | style: TextStyle(color: Colors.redAccent, fontSize: 20), 58 | ), 59 | ], 60 | ), 61 | ), 62 | ), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /example/lib/explode_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:korea_regexp/korea_regexp.dart'; 3 | 4 | class ExplodePage extends StatefulWidget { 5 | const ExplodePage({Key? key}) : super(key: key); 6 | 7 | @override 8 | _ExplodePageState createState() => _ExplodePageState(); 9 | } 10 | 11 | class _ExplodePageState extends State { 12 | late TextEditingController controller; 13 | late dynamic text = ''; 14 | bool grouped = false; 15 | 16 | @override 17 | void initState() { 18 | super.initState(); 19 | controller = TextEditingController(text: '불닭'); 20 | } 21 | 22 | @override 23 | void dispose() { 24 | controller.dispose(); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | appBar: AppBar( 32 | title: Text("자소분리"), 33 | ), 34 | body: SingleChildScrollView( 35 | child: Padding( 36 | padding: const EdgeInsets.all(8.0), 37 | child: Column( 38 | children: [ 39 | Row( 40 | children: [ 41 | Expanded( 42 | child: TextField( 43 | controller: controller, 44 | )), 45 | OutlinedButton( 46 | onPressed: () { 47 | setState(() { 48 | text = explode(controller.text, grouped: grouped); 49 | }); 50 | }, 51 | child: Text("변환")), 52 | ], 53 | ), 54 | Row( 55 | children: [ 56 | Text("그룹화 여부"), 57 | Checkbox( 58 | value: grouped, 59 | onChanged: (bool? value) { 60 | setState(() { 61 | grouped = value!; 62 | }); 63 | }), 64 | ], 65 | ), 66 | Text("false 예시) 불닭 : '['ㅂ', 'ㅜ', 'ㄹ', 'ㄷ', 'ㅏ', 'ㄹ', 'ㄱ']"), 67 | Text("true 예시) 불닭 : [['ㅂ', 'ㅜ', 'ㄹ'], ['ㄷ', 'ㅏ', 'ㄹ', 'ㄱ']]"), 68 | Text( 69 | text.toString(), 70 | style: TextStyle(color: Colors.redAccent, fontSize: 20), 71 | ), 72 | ], 73 | ), 74 | ), 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /example/lib/implode_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:korea_regexp/korea_regexp.dart'; 3 | 4 | class ImplodePage extends StatefulWidget { 5 | const ImplodePage({Key? key}) : super(key: key); 6 | 7 | @override 8 | _ImplodePageState createState() => _ImplodePageState(); 9 | } 10 | 11 | class _ImplodePageState extends State { 12 | late TextEditingController controller; 13 | var text = ''; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | controller = TextEditingController(text: 'ㅂㅜㄹㄷㅏㄹㄱ'); 19 | } 20 | 21 | @override 22 | void dispose() { 23 | controller.dispose(); 24 | super.dispose(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar( 31 | title: Text("자소 합치기"), 32 | ), 33 | body: SingleChildScrollView( 34 | child: Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: Column( 37 | children: [ 38 | Row( 39 | children: [ 40 | Expanded( 41 | child: TextField( 42 | controller: controller, 43 | ), 44 | ), 45 | OutlinedButton( 46 | onPressed: () { 47 | setState(() { 48 | text = implode(controller.text); 49 | }); 50 | }, 51 | child: Text("변환"), 52 | ), 53 | ], 54 | ), 55 | Text( 56 | text, 57 | style: TextStyle(color: Colors.redAccent, fontSize: 20), 58 | ), 59 | ], 60 | ), 61 | ), 62 | ), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /example/lib/kor_to_eng_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:korea_regexp/korea_regexp.dart'; 3 | 4 | class KorToEngPage extends StatefulWidget { 5 | const KorToEngPage({Key? key}) : super(key: key); 6 | 7 | @override 8 | _KorToEngPageState createState() => _KorToEngPageState(); 9 | } 10 | 11 | class _KorToEngPageState extends State { 12 | late TextEditingController controller; 13 | String text = ''; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | controller = TextEditingController(text: 'ㅗ디ㅣㅐ 재깅!'); 19 | } 20 | 21 | @override 22 | void dispose() { 23 | controller.dispose(); 24 | super.dispose(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar( 31 | title: Text("한글 -> 영어 테스트"), 32 | ), 33 | body: SingleChildScrollView( 34 | child: Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: Column( 37 | children: [ 38 | Row( 39 | children: [ 40 | Expanded( 41 | child: TextField( 42 | controller: controller, 43 | )), 44 | OutlinedButton( 45 | onPressed: () { 46 | setState(() { 47 | text = korToEng(controller.text); 48 | }); 49 | }, 50 | child: Text("변환")), 51 | ], 52 | ), 53 | Text(text,style: TextStyle(color: Colors.redAccent, fontSize: 20),), 54 | ], 55 | ), 56 | ), 57 | ), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:csv/csv.dart'; 2 | import 'package:example/correct_postpositions_page.dart'; 3 | import 'package:example/eng_to_kor_page.dart'; 4 | import 'package:example/explode_page.dart'; 5 | import 'package:example/implode_page.dart'; 6 | import 'package:example/kor_to_eng_page.dart'; 7 | import 'package:example/reg_exp_page.dart'; 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter/services.dart'; 10 | 11 | late var searchTerms; 12 | 13 | void main() async { 14 | WidgetsFlutterBinding.ensureInitialized(); 15 | final csv = await rootBundle.loadString('assets/search_address.csv'); 16 | searchTerms = const CsvToListConverter().convert(csv); 17 | searchTerms 18 | .sort((List a, List b) => (a[0] as String).compareTo(b[0] as String)); 19 | runApp(MyApp()); 20 | } 21 | 22 | class MyApp extends StatelessWidget { 23 | @override 24 | Widget build(BuildContext context) { 25 | return MaterialApp( 26 | debugShowCheckedModeBanner: false, 27 | home: HomePage(), 28 | ); 29 | } 30 | } 31 | 32 | class HomePage extends StatelessWidget { 33 | const HomePage({Key? key}) : super(key: key); 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | appBar: AppBar( 39 | centerTitle: true, 40 | title: Text("플러터 한국어 정규표현식"), 41 | ), 42 | body: Center( 43 | child: Column( 44 | mainAxisSize: MainAxisSize.min, 45 | children: [ 46 | TextButton( 47 | onPressed: () { 48 | Navigator.push(context, 49 | MaterialPageRoute(builder: (context) => ExplodePage())); 50 | }, 51 | child: Text("자소 분리"), 52 | ), 53 | TextButton( 54 | onPressed: () { 55 | Navigator.push(context, 56 | MaterialPageRoute(builder: (context) => ImplodePage())); 57 | }, 58 | child: Text("자소 합치기"), 59 | ), 60 | TextButton( 61 | onPressed: () { 62 | Navigator.push(context, 63 | MaterialPageRoute(builder: (context) => KorToEngPage())); 64 | }, 65 | child: Text("한글 -> 영어"), 66 | ), 67 | TextButton( 68 | onPressed: () { 69 | Navigator.push(context, 70 | MaterialPageRoute(builder: (context) => EngToKorPage())); 71 | }, 72 | child: Text("영어 -> 한글"), 73 | ), 74 | TextButton( 75 | onPressed: () { 76 | Navigator.push(context, 77 | MaterialPageRoute(builder: (context) => KoreaRegExpPage())); 78 | }, 79 | child: Text("한글 정규 표현식"), 80 | ), 81 | TextButton( 82 | onPressed: () { 83 | Navigator.push( 84 | context, 85 | MaterialPageRoute( 86 | builder: (context) => CorrectPostPositionsPage())); 87 | }, 88 | child: Text("조사 자동 치환"), 89 | ), 90 | ], 91 | ), 92 | ), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /example/lib/reg_exp_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/reg_exp_text_field.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | bool initialSearch = false; 5 | bool startsWith = false; 6 | bool endsWith = false; 7 | bool ignoreSpace = false; 8 | bool ignoreCase = false; 9 | bool fuzzy = false; 10 | 11 | class KoreaRegExpPage extends StatefulWidget { 12 | const KoreaRegExpPage({Key? key}) : super(key: key); 13 | 14 | @override 15 | _KoreaRegExpPageState createState() => _KoreaRegExpPageState(); 16 | } 17 | 18 | class _KoreaRegExpPageState extends State { 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: AppBar( 23 | title: Text("한글 자동완성을 위한 정규식"), 24 | ), 25 | body: SingleChildScrollView( 26 | child: Padding( 27 | padding: const EdgeInsets.all(8.0), 28 | child: Column( 29 | children: [ 30 | Row( 31 | children: [ 32 | checkBox("initialSearch", initialSearch, (value) { 33 | setState(() { 34 | initialSearch = value; 35 | }); 36 | }), 37 | checkBox("startsWith", startsWith, (value) { 38 | setState(() { 39 | startsWith = value; 40 | }); 41 | }), 42 | checkBox("endsWith", endsWith, (value) { 43 | setState(() { 44 | endsWith = value; 45 | }); 46 | }), 47 | ], 48 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 49 | ), 50 | Row( 51 | children: [ 52 | checkBox("ignoreSpace", ignoreSpace, (value) { 53 | setState(() { 54 | ignoreSpace = value; 55 | }); 56 | }), 57 | checkBox("ignoreCase", ignoreCase, (value) { 58 | setState(() { 59 | ignoreCase = value; 60 | }); 61 | }), 62 | checkBox("fuzzy", fuzzy, (value) { 63 | setState(() { 64 | fuzzy = value; 65 | }); 66 | }), 67 | ], 68 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 69 | ), 70 | const RegExpTextField() 71 | ], 72 | )), 73 | ), 74 | ); 75 | } 76 | 77 | Row checkBox(String text, bool aValue, ValueChanged onChanged) { 78 | return Row( 79 | children: [ 80 | Text(text), 81 | Checkbox(value: aValue, onChanged: onChanged), 82 | ], 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /example/lib/reg_exp_text_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:example/main.dart'; 2 | import 'package:example/reg_exp_page.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:korea_regexp/korea_regexp.dart'; 5 | 6 | class RegExpTextField extends StatefulWidget { 7 | const RegExpTextField({Key? key}) : super(key: key); 8 | 9 | @override 10 | _RegExpTextFieldState createState() => _RegExpTextFieldState(); 11 | } 12 | 13 | class _RegExpTextFieldState extends State { 14 | 15 | OverlayEntry? overlayEntry; 16 | final LayerLink _layerLink = LayerLink(); 17 | late List> terms; 18 | late final TextEditingController textController; 19 | late final FocusNode focusNode; 20 | late final ScrollController scrollController; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | textController = TextEditingController(); 26 | scrollController = ScrollController(); 27 | focusNode = FocusNode(); 28 | terms = searchTerms; 29 | 30 | focusNode.addListener(() { 31 | if (focusNode.hasFocus) { 32 | if (overlayEntry == null) { 33 | overlayEntry = _createOverlayEntry(); 34 | Overlay.of(context).insert(overlayEntry!); 35 | } 36 | } else { 37 | if (overlayEntry?.mounted ?? false) { 38 | overlayEntry?.remove(); 39 | overlayEntry = null; 40 | } 41 | } 42 | }); 43 | 44 | textController.addListener(() { 45 | if (textController.text.isNotEmpty) { 46 | changeSearchTerm(textController.text); 47 | } else { 48 | clearSearchTerm(); 49 | } 50 | }); 51 | } 52 | 53 | @override 54 | void dispose() { 55 | textController.dispose(); 56 | scrollController.dispose(); 57 | focusNode.dispose(); 58 | super.dispose(); 59 | } 60 | 61 | @override 62 | Widget build(BuildContext context) { 63 | return CompositedTransformTarget( 64 | link: _layerLink, 65 | child: SafeArea( 66 | child: SizedBox( 67 | height: 40, 68 | child: TextField( 69 | focusNode: focusNode, 70 | controller: textController, 71 | ), 72 | ), 73 | ), 74 | ); 75 | } 76 | 77 | OverlayEntry _createOverlayEntry() { 78 | RenderBox renderBox = context.findRenderObject() as RenderBox; 79 | var size = renderBox.size; 80 | var offset = renderBox.localToGlobal(Offset.zero); 81 | return OverlayEntry( 82 | builder: (context) => Positioned( 83 | left: offset.dx, 84 | top: offset.dy + size.height, 85 | width: size.width, 86 | child: Material( 87 | elevation: 4.0, 88 | child: Container( 89 | height: 400, 90 | child: (terms.isNotEmpty) 91 | ? ListView.builder( 92 | controller: scrollController, 93 | padding: const EdgeInsets.only(bottom: 200), 94 | itemCount: terms.length, 95 | itemBuilder: (context, index) { 96 | return ListTile(title: Text(terms[index][0], )); 97 | }) 98 | : const Center( 99 | child: Text("검색어가 없습니다."), 100 | )), 101 | )), 102 | ); 103 | } 104 | 105 | void clearSearchTerm() { 106 | terms = searchTerms; 107 | } 108 | 109 | void changeSearchTerm(String text) { 110 | List> list = searchTerms; 111 | 112 | RegExp regExp = getRegExp( 113 | text, 114 | RegExpOptions( 115 | initialSearch: initialSearch, 116 | startsWith: startsWith, 117 | endsWith: endsWith, 118 | fuzzy: fuzzy, 119 | ignoreSpace: ignoreSpace, 120 | ignoreCase: ignoreCase, 121 | )); 122 | 123 | terms = 124 | list.where((element) => regExp.hasMatch(element[0] as String)).toList(); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/xcuserdata/ 7 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXAggregateTarget section */ 10 | 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { 11 | isa = PBXAggregateTarget; 12 | buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; 13 | buildPhases = ( 14 | 33CC111E2044C6BF0003C045 /* ShellScript */, 15 | ); 16 | dependencies = ( 17 | ); 18 | name = "Flutter Assemble"; 19 | productName = FLX; 20 | }; 21 | /* End PBXAggregateTarget section */ 22 | 23 | /* Begin PBXBuildFile section */ 24 | 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 25 | 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 26 | 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 27 | 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 28 | 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 33CC10E52044A3C60003C045 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 33CC111A2044C6BA0003C045; 37 | remoteInfo = FLX; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXCopyFilesBuildPhase section */ 42 | 33CC110E2044A8840003C045 /* Bundle Framework */ = { 43 | isa = PBXCopyFilesBuildPhase; 44 | buildActionMask = 2147483647; 45 | dstPath = ""; 46 | dstSubfolderSpec = 10; 47 | files = ( 48 | ); 49 | name = "Bundle Framework"; 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXCopyFilesBuildPhase section */ 53 | 54 | /* Begin PBXFileReference section */ 55 | 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 56 | 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; 57 | 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 59 | 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 60 | 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 61 | 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; 62 | 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; 63 | 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; 64 | 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; 65 | 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; 66 | 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 67 | 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 68 | 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; 69 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 70 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; 71 | /* End PBXFileReference section */ 72 | 73 | /* Begin PBXFrameworksBuildPhase section */ 74 | 33CC10EA2044A3C60003C045 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 33BA886A226E78AF003329D5 /* Configs */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 33E5194F232828860026EE4D /* AppInfo.xcconfig */, 88 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 89 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 90 | 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, 91 | ); 92 | path = Configs; 93 | sourceTree = ""; 94 | }; 95 | 33CC10E42044A3C60003C045 = { 96 | isa = PBXGroup; 97 | children = ( 98 | 33FAB671232836740065AC1E /* Runner */, 99 | 33CEB47122A05771004F2AC0 /* Flutter */, 100 | 33CC10EE2044A3C60003C045 /* Products */, 101 | D73912EC22F37F3D000D13A0 /* Frameworks */, 102 | ); 103 | sourceTree = ""; 104 | }; 105 | 33CC10EE2044A3C60003C045 /* Products */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 33CC10ED2044A3C60003C045 /* example.app */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 33CC11242044D66E0003C045 /* Resources */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 33CC10F22044A3C60003C045 /* Assets.xcassets */, 117 | 33CC10F42044A3C60003C045 /* MainMenu.xib */, 118 | 33CC10F72044A3C60003C045 /* Info.plist */, 119 | ); 120 | name = Resources; 121 | path = ..; 122 | sourceTree = ""; 123 | }; 124 | 33CEB47122A05771004F2AC0 /* Flutter */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 128 | 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 129 | 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, 130 | 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, 131 | ); 132 | path = Flutter; 133 | sourceTree = ""; 134 | }; 135 | 33FAB671232836740065AC1E /* Runner */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 33CC10F02044A3C60003C045 /* AppDelegate.swift */, 139 | 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, 140 | 33E51913231747F40026EE4D /* DebugProfile.entitlements */, 141 | 33E51914231749380026EE4D /* Release.entitlements */, 142 | 33CC11242044D66E0003C045 /* Resources */, 143 | 33BA886A226E78AF003329D5 /* Configs */, 144 | ); 145 | path = Runner; 146 | sourceTree = ""; 147 | }; 148 | D73912EC22F37F3D000D13A0 /* Frameworks */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | ); 152 | name = Frameworks; 153 | sourceTree = ""; 154 | }; 155 | /* End PBXGroup section */ 156 | 157 | /* Begin PBXNativeTarget section */ 158 | 33CC10EC2044A3C60003C045 /* Runner */ = { 159 | isa = PBXNativeTarget; 160 | buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; 161 | buildPhases = ( 162 | 33CC10E92044A3C60003C045 /* Sources */, 163 | 33CC10EA2044A3C60003C045 /* Frameworks */, 164 | 33CC10EB2044A3C60003C045 /* Resources */, 165 | 33CC110E2044A8840003C045 /* Bundle Framework */, 166 | 3399D490228B24CF009A79C7 /* ShellScript */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | 33CC11202044C79F0003C045 /* PBXTargetDependency */, 172 | ); 173 | name = Runner; 174 | productName = Runner; 175 | productReference = 33CC10ED2044A3C60003C045 /* example.app */; 176 | productType = "com.apple.product-type.application"; 177 | }; 178 | /* End PBXNativeTarget section */ 179 | 180 | /* Begin PBXProject section */ 181 | 33CC10E52044A3C60003C045 /* Project object */ = { 182 | isa = PBXProject; 183 | attributes = { 184 | LastSwiftUpdateCheck = 0920; 185 | LastUpgradeCheck = 0930; 186 | ORGANIZATIONNAME = ""; 187 | TargetAttributes = { 188 | 33CC10EC2044A3C60003C045 = { 189 | CreatedOnToolsVersion = 9.2; 190 | LastSwiftMigration = 1100; 191 | ProvisioningStyle = Automatic; 192 | SystemCapabilities = { 193 | com.apple.Sandbox = { 194 | enabled = 1; 195 | }; 196 | }; 197 | }; 198 | 33CC111A2044C6BA0003C045 = { 199 | CreatedOnToolsVersion = 9.2; 200 | ProvisioningStyle = Manual; 201 | }; 202 | }; 203 | }; 204 | buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; 205 | compatibilityVersion = "Xcode 9.3"; 206 | developmentRegion = en; 207 | hasScannedForEncodings = 0; 208 | knownRegions = ( 209 | en, 210 | Base, 211 | ); 212 | mainGroup = 33CC10E42044A3C60003C045; 213 | productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 33CC10EC2044A3C60003C045 /* Runner */, 218 | 33CC111A2044C6BA0003C045 /* Flutter Assemble */, 219 | ); 220 | }; 221 | /* End PBXProject section */ 222 | 223 | /* Begin PBXResourcesBuildPhase section */ 224 | 33CC10EB2044A3C60003C045 /* Resources */ = { 225 | isa = PBXResourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, 229 | 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | /* End PBXResourcesBuildPhase section */ 234 | 235 | /* Begin PBXShellScriptBuildPhase section */ 236 | 3399D490228B24CF009A79C7 /* ShellScript */ = { 237 | isa = PBXShellScriptBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | inputFileListPaths = ( 242 | ); 243 | inputPaths = ( 244 | ); 245 | outputFileListPaths = ( 246 | ); 247 | outputPaths = ( 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; 252 | }; 253 | 33CC111E2044C6BF0003C045 /* ShellScript */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputFileListPaths = ( 259 | Flutter/ephemeral/FlutterInputs.xcfilelist, 260 | ); 261 | inputPaths = ( 262 | Flutter/ephemeral/tripwire, 263 | ); 264 | outputFileListPaths = ( 265 | Flutter/ephemeral/FlutterOutputs.xcfilelist, 266 | ); 267 | outputPaths = ( 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | shellPath = /bin/sh; 271 | shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; 272 | }; 273 | /* End PBXShellScriptBuildPhase section */ 274 | 275 | /* Begin PBXSourcesBuildPhase section */ 276 | 33CC10E92044A3C60003C045 /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, 281 | 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, 282 | 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXSourcesBuildPhase section */ 287 | 288 | /* Begin PBXTargetDependency section */ 289 | 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { 290 | isa = PBXTargetDependency; 291 | target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; 292 | targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; 293 | }; 294 | /* End PBXTargetDependency section */ 295 | 296 | /* Begin PBXVariantGroup section */ 297 | 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { 298 | isa = PBXVariantGroup; 299 | children = ( 300 | 33CC10F52044A3C60003C045 /* Base */, 301 | ); 302 | name = MainMenu.xib; 303 | path = Runner; 304 | sourceTree = ""; 305 | }; 306 | /* End PBXVariantGroup section */ 307 | 308 | /* Begin XCBuildConfiguration section */ 309 | 338D0CE9231458BD00FA5F75 /* Profile */ = { 310 | isa = XCBuildConfiguration; 311 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 316 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 317 | CLANG_CXX_LIBRARY = "libc++"; 318 | CLANG_ENABLE_MODULES = YES; 319 | CLANG_ENABLE_OBJC_ARC = YES; 320 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 321 | CLANG_WARN_BOOL_CONVERSION = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 326 | CLANG_WARN_EMPTY_BODY = YES; 327 | CLANG_WARN_ENUM_CONVERSION = YES; 328 | CLANG_WARN_INFINITE_RECURSION = YES; 329 | CLANG_WARN_INT_CONVERSION = YES; 330 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 335 | CODE_SIGN_IDENTITY = "-"; 336 | COPY_PHASE_STRIP = NO; 337 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 338 | ENABLE_NS_ASSERTIONS = NO; 339 | ENABLE_STRICT_OBJC_MSGSEND = YES; 340 | GCC_C_LANGUAGE_STANDARD = gnu11; 341 | GCC_NO_COMMON_BLOCKS = YES; 342 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 343 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 344 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 345 | GCC_WARN_UNUSED_FUNCTION = YES; 346 | GCC_WARN_UNUSED_VARIABLE = YES; 347 | MACOSX_DEPLOYMENT_TARGET = 10.11; 348 | MTL_ENABLE_DEBUG_INFO = NO; 349 | SDKROOT = macosx; 350 | SWIFT_COMPILATION_MODE = wholemodule; 351 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 352 | }; 353 | name = Profile; 354 | }; 355 | 338D0CEA231458BD00FA5F75 /* Profile */ = { 356 | isa = XCBuildConfiguration; 357 | baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; 358 | buildSettings = { 359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 360 | CLANG_ENABLE_MODULES = YES; 361 | CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; 362 | CODE_SIGN_STYLE = Automatic; 363 | COMBINE_HIDPI_IMAGES = YES; 364 | INFOPLIST_FILE = Runner/Info.plist; 365 | LD_RUNPATH_SEARCH_PATHS = ( 366 | "$(inherited)", 367 | "@executable_path/../Frameworks", 368 | ); 369 | PROVISIONING_PROFILE_SPECIFIER = ""; 370 | SWIFT_VERSION = 5.0; 371 | }; 372 | name = Profile; 373 | }; 374 | 338D0CEB231458BD00FA5F75 /* Profile */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | CODE_SIGN_STYLE = Manual; 378 | PRODUCT_NAME = "$(TARGET_NAME)"; 379 | }; 380 | name = Profile; 381 | }; 382 | 33CC10F92044A3C60003C045 /* Debug */ = { 383 | isa = XCBuildConfiguration; 384 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 385 | buildSettings = { 386 | ALWAYS_SEARCH_USER_PATHS = NO; 387 | CLANG_ANALYZER_NONNULL = YES; 388 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 389 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 390 | CLANG_CXX_LIBRARY = "libc++"; 391 | CLANG_ENABLE_MODULES = YES; 392 | CLANG_ENABLE_OBJC_ARC = YES; 393 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 394 | CLANG_WARN_BOOL_CONVERSION = YES; 395 | CLANG_WARN_CONSTANT_CONVERSION = YES; 396 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 397 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 398 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INFINITE_RECURSION = YES; 402 | CLANG_WARN_INT_CONVERSION = YES; 403 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 404 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 405 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 406 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 407 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 408 | CODE_SIGN_IDENTITY = "-"; 409 | COPY_PHASE_STRIP = NO; 410 | DEBUG_INFORMATION_FORMAT = dwarf; 411 | ENABLE_STRICT_OBJC_MSGSEND = YES; 412 | ENABLE_TESTABILITY = YES; 413 | GCC_C_LANGUAGE_STANDARD = gnu11; 414 | GCC_DYNAMIC_NO_PIC = NO; 415 | GCC_NO_COMMON_BLOCKS = YES; 416 | GCC_OPTIMIZATION_LEVEL = 0; 417 | GCC_PREPROCESSOR_DEFINITIONS = ( 418 | "DEBUG=1", 419 | "$(inherited)", 420 | ); 421 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 422 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | MACOSX_DEPLOYMENT_TARGET = 10.11; 427 | MTL_ENABLE_DEBUG_INFO = YES; 428 | ONLY_ACTIVE_ARCH = YES; 429 | SDKROOT = macosx; 430 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 431 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 432 | }; 433 | name = Debug; 434 | }; 435 | 33CC10FA2044A3C60003C045 /* Release */ = { 436 | isa = XCBuildConfiguration; 437 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 438 | buildSettings = { 439 | ALWAYS_SEARCH_USER_PATHS = NO; 440 | CLANG_ANALYZER_NONNULL = YES; 441 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 442 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 443 | CLANG_CXX_LIBRARY = "libc++"; 444 | CLANG_ENABLE_MODULES = YES; 445 | CLANG_ENABLE_OBJC_ARC = YES; 446 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 447 | CLANG_WARN_BOOL_CONVERSION = YES; 448 | CLANG_WARN_CONSTANT_CONVERSION = YES; 449 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 450 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 451 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 452 | CLANG_WARN_EMPTY_BODY = YES; 453 | CLANG_WARN_ENUM_CONVERSION = YES; 454 | CLANG_WARN_INFINITE_RECURSION = YES; 455 | CLANG_WARN_INT_CONVERSION = YES; 456 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 457 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 458 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 459 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 460 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 461 | CODE_SIGN_IDENTITY = "-"; 462 | COPY_PHASE_STRIP = NO; 463 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 464 | ENABLE_NS_ASSERTIONS = NO; 465 | ENABLE_STRICT_OBJC_MSGSEND = YES; 466 | GCC_C_LANGUAGE_STANDARD = gnu11; 467 | GCC_NO_COMMON_BLOCKS = YES; 468 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 469 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 470 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 471 | GCC_WARN_UNUSED_FUNCTION = YES; 472 | GCC_WARN_UNUSED_VARIABLE = YES; 473 | MACOSX_DEPLOYMENT_TARGET = 10.11; 474 | MTL_ENABLE_DEBUG_INFO = NO; 475 | SDKROOT = macosx; 476 | SWIFT_COMPILATION_MODE = wholemodule; 477 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 478 | }; 479 | name = Release; 480 | }; 481 | 33CC10FC2044A3C60003C045 /* Debug */ = { 482 | isa = XCBuildConfiguration; 483 | baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; 484 | buildSettings = { 485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 486 | CLANG_ENABLE_MODULES = YES; 487 | CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; 488 | CODE_SIGN_STYLE = Automatic; 489 | COMBINE_HIDPI_IMAGES = YES; 490 | INFOPLIST_FILE = Runner/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | "@executable_path/../Frameworks", 494 | ); 495 | PROVISIONING_PROFILE_SPECIFIER = ""; 496 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 497 | SWIFT_VERSION = 5.0; 498 | }; 499 | name = Debug; 500 | }; 501 | 33CC10FD2044A3C60003C045 /* Release */ = { 502 | isa = XCBuildConfiguration; 503 | baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; 504 | buildSettings = { 505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 506 | CLANG_ENABLE_MODULES = YES; 507 | CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; 508 | CODE_SIGN_STYLE = Automatic; 509 | COMBINE_HIDPI_IMAGES = YES; 510 | INFOPLIST_FILE = Runner/Info.plist; 511 | LD_RUNPATH_SEARCH_PATHS = ( 512 | "$(inherited)", 513 | "@executable_path/../Frameworks", 514 | ); 515 | PROVISIONING_PROFILE_SPECIFIER = ""; 516 | SWIFT_VERSION = 5.0; 517 | }; 518 | name = Release; 519 | }; 520 | 33CC111C2044C6BA0003C045 /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | CODE_SIGN_STYLE = Manual; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | }; 526 | name = Debug; 527 | }; 528 | 33CC111D2044C6BA0003C045 /* Release */ = { 529 | isa = XCBuildConfiguration; 530 | buildSettings = { 531 | CODE_SIGN_STYLE = Automatic; 532 | PRODUCT_NAME = "$(TARGET_NAME)"; 533 | }; 534 | name = Release; 535 | }; 536 | /* End XCBuildConfiguration section */ 537 | 538 | /* Begin XCConfigurationList section */ 539 | 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 33CC10F92044A3C60003C045 /* Debug */, 543 | 33CC10FA2044A3C60003C045 /* Release */, 544 | 338D0CE9231458BD00FA5F75 /* Profile */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { 550 | isa = XCConfigurationList; 551 | buildConfigurations = ( 552 | 33CC10FC2044A3C60003C045 /* Debug */, 553 | 33CC10FD2044A3C60003C045 /* Release */, 554 | 338D0CEA231458BD00FA5F75 /* Profile */, 555 | ); 556 | defaultConfigurationIsVisible = 0; 557 | defaultConfigurationName = Release; 558 | }; 559 | 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | 33CC111C2044C6BA0003C045 /* Debug */, 563 | 33CC111D2044C6BA0003C045 /* Release */, 564 | 338D0CEB231458BD00FA5F75 /* Profile */, 565 | ); 566 | defaultConfigurationIsVisible = 0; 567 | defaultConfigurationName = Release; 568 | }; 569 | /* End XCConfigurationList section */ 570 | }; 571 | rootObject = 33CC10E52044A3C60003C045 /* Project object */; 572 | } 573 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 64 | 65 | 71 | 73 | 79 | 80 | 81 | 82 | 84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /example/macos/Runner/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.2" 44 | csv: 45 | dependency: "direct main" 46 | description: 47 | name: csv 48 | sha256: "016b31a51a913744a0a1655c74ff13c9379e1200e246a03d96c81c5d9ed297b5" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "5.0.2" 52 | cupertino_icons: 53 | dependency: "direct main" 54 | description: 55 | name: cupertino_icons 56 | sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.0.6" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "1.3.1" 68 | flutter: 69 | dependency: "direct main" 70 | description: flutter 71 | source: sdk 72 | version: "0.0.0" 73 | flutter_test: 74 | dependency: "direct dev" 75 | description: flutter 76 | source: sdk 77 | version: "0.0.0" 78 | korea_regexp: 79 | dependency: "direct main" 80 | description: 81 | path: ".." 82 | relative: true 83 | source: path 84 | version: "1.0.1" 85 | matcher: 86 | dependency: transitive 87 | description: 88 | name: matcher 89 | sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "0.12.16" 93 | material_color_utilities: 94 | dependency: transitive 95 | description: 96 | name: material_color_utilities 97 | sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "0.5.0" 101 | meta: 102 | dependency: transitive 103 | description: 104 | name: meta 105 | sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "1.9.1" 109 | path: 110 | dependency: transitive 111 | description: 112 | name: path 113 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "1.8.3" 117 | sky_engine: 118 | dependency: transitive 119 | description: flutter 120 | source: sdk 121 | version: "0.0.99" 122 | source_span: 123 | dependency: transitive 124 | description: 125 | name: source_span 126 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 127 | url: "https://pub.dev" 128 | source: hosted 129 | version: "1.10.0" 130 | stack_trace: 131 | dependency: transitive 132 | description: 133 | name: stack_trace 134 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 135 | url: "https://pub.dev" 136 | source: hosted 137 | version: "1.11.0" 138 | stream_channel: 139 | dependency: transitive 140 | description: 141 | name: stream_channel 142 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 143 | url: "https://pub.dev" 144 | source: hosted 145 | version: "2.1.1" 146 | string_scanner: 147 | dependency: transitive 148 | description: 149 | name: string_scanner 150 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "1.2.0" 154 | term_glyph: 155 | dependency: transitive 156 | description: 157 | name: term_glyph 158 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "1.2.1" 162 | test_api: 163 | dependency: transitive 164 | description: 165 | name: test_api 166 | sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "0.6.0" 170 | vector_math: 171 | dependency: transitive 172 | description: 173 | name: vector_math 174 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "2.1.4" 178 | web: 179 | dependency: transitive 180 | description: 181 | name: web 182 | sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "0.1.4-beta" 186 | sdks: 187 | dart: ">=3.1.0-185.0.dev <4.0.0" 188 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.14.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | korea_regexp: 13 | path: ../ 14 | csv: ^5.0.0 15 | cupertino_icons: ^1.0.2 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | flutter: 22 | uses-material-design: true 23 | 24 | assets: 25 | - assets/search_address.csv 26 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jpoh281/flutter_korea_regexp/b3ee56e0509caffcc41f99252e90928120e9b5cb/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | example 27 | 28 | 29 | 30 | 33 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /lib/korea_regexp.dart: -------------------------------------------------------------------------------- 1 | export 'package:korea_regexp/src/models/phonemes_result.dart'; 2 | export 'package:korea_regexp/src/models/regexp_options.dart'; 3 | export 'package:korea_regexp/src/get_phonemes.dart'; 4 | export 'package:korea_regexp/src/get_regexp.dart' show getRegExp; 5 | export 'package:korea_regexp/src/implode.dart' show implode; 6 | export 'package:korea_regexp/src/kor_to_eng.dart' show korToEng; 7 | export 'package:korea_regexp/src/eng_to_kor.dart' show engToKor; 8 | export 'package:korea_regexp/src/correct_postpositions.dart' show correctPostpositions; 9 | export 'package:korea_regexp/src/explode.dart'; 10 | export 'package:korea_regexp/src/escape_regexp.dart'; -------------------------------------------------------------------------------- /lib/src/constant.dart: -------------------------------------------------------------------------------- 1 | // 초성으로만 존재하는 한글 확인 2 | const String onlyInitialKorean = r'[ㄱ-ㅎ]'; 3 | RegExp onlyInitialKoreanRegex = RegExp(onlyInitialKorean); 4 | 5 | // 완성된 한글 확인 6 | const String completedKorean = r'[가-힣]'; 7 | RegExp completedKoreanRegex = RegExp(completedKorean); 8 | 9 | int base = '가'.runes.first; // 한글 코드 시작: 44032 10 | 11 | const initials = [ 12 | 'ㄱ', 13 | 'ㄲ', 14 | 'ㄴ', 15 | 'ㄷ', 16 | 'ㄸ', 17 | 'ㄹ', 18 | 'ㅁ', 19 | 'ㅂ', 20 | 'ㅃ', 21 | 'ㅅ', 22 | 'ㅆ', 23 | 'ㅇ', 24 | 'ㅈ', 25 | 'ㅉ', 26 | 'ㅊ', 27 | 'ㅋ', 28 | 'ㅌ', 29 | 'ㅍ', 30 | 'ㅎ' 31 | ]; 32 | 33 | const medials = [ 34 | 'ㅏ', 35 | 'ㅐ', 36 | 'ㅑ', 37 | 'ㅒ', 38 | 'ㅓ', 39 | 'ㅔ', 40 | 'ㅕ', 41 | 'ㅖ', 42 | 'ㅗ', 43 | 'ㅘ', 44 | 'ㅙ', 45 | 'ㅚ', 46 | 'ㅛ', 47 | 'ㅜ', 48 | 'ㅝ', 49 | 'ㅞ', 50 | 'ㅟ', 51 | 'ㅠ', 52 | 'ㅡ', 53 | 'ㅢ', 54 | 'ㅣ' 55 | ]; 56 | 57 | const finales = [ 58 | '', 59 | 'ㄱ', 60 | 'ㄲ', 61 | 'ㄳ', 62 | 'ㄴ', 63 | 'ㄵ', 64 | 'ㄶ', 65 | 'ㄷ', 66 | 'ㄹ', 67 | 'ㄺ', 68 | 'ㄻ', 69 | 'ㄼ', 70 | 'ㄽ', 71 | 'ㄾ', 72 | 'ㄿ', 73 | 'ㅀ', 74 | 'ㅁ', 75 | 'ㅂ', 76 | 'ㅄ', 77 | 'ㅅ', 78 | 'ㅆ', 79 | 'ㅇ', 80 | 'ㅈ', 81 | 'ㅊ', 82 | 'ㅋ', 83 | 'ㅌ', 84 | 'ㅍ', 85 | 'ㅎ' 86 | ]; 87 | 88 | const Map> mixed = { 89 | ...finaleMixed, 90 | ...medialMixed, 91 | }; 92 | 93 | const Map> finaleMixed = { 94 | 'ㄲ': ['ㄱ', 'ㄱ'], 95 | 'ㄳ': ['ㄱ', 'ㅅ'], 96 | 'ㄵ': ['ㄴ', 'ㅈ'], 97 | 'ㄶ': ['ㄴ', 'ㅎ'], 98 | 'ㄺ': ['ㄹ', 'ㄱ'], 99 | 'ㄻ': ['ㄹ', 'ㅁ'], 100 | 'ㄼ': ['ㄹ', 'ㅂ'], 101 | 'ㄽ': ['ㄹ', 'ㅅ'], 102 | 'ㄾ': ['ㄹ', 'ㅌ'], 103 | 'ㄿ': ['ㄹ', 'ㅍ'], 104 | 'ㅀ': ['ㄹ', 'ㅎ'], 105 | 'ㅄ': ['ㅂ', 'ㅅ'], 106 | 'ㅆ': ['ㅅ', 'ㅅ'], 107 | }; 108 | const Map> medialMixed = { 109 | 'ㅘ': ['ㅗ', 'ㅏ'], 110 | 'ㅙ': ['ㅗ', 'ㅐ'], 111 | 'ㅚ': ['ㅗ', 'ㅣ'], 112 | 'ㅝ': ['ㅜ', 'ㅓ'], 113 | 'ㅞ': ['ㅜ', 'ㅔ'], 114 | 'ㅟ': ['ㅜ', 'ㅣ'], 115 | 'ㅢ': ['ㅡ', 'ㅣ'] 116 | }; 117 | 118 | const Map> medialRange = { 119 | 'ㅗ': ['ㅗ', 'ㅚ'], 120 | 'ㅜ': ['ㅜ', 'ㅟ'], 121 | 'ㅡ': ['ㅡ', 'ㅢ'] 122 | }; 123 | 124 | const List presentOnKeyboard = [ 125 | 'ㄱ', 126 | 'ㄲ', 127 | 'ㄴ', 128 | 'ㄷ', 129 | 'ㄸ', 130 | 'ㄹ', 131 | 'ㅁ', 132 | 'ㅂ', 133 | 'ㅃ', 134 | 'ㅅ', 135 | 'ㅆ', 136 | 'ㅇ', 137 | 'ㅈ', 138 | 'ㅉ', 139 | 'ㅊ', 140 | 'ㅋ', 141 | 'ㅌ', 142 | 'ㅍ', 143 | 'ㅎ', 144 | 'ㅏ', 145 | 'ㅐ', 146 | 'ㅑ', 147 | 'ㅒ', 148 | 'ㅓ', 149 | 'ㅔ', 150 | 'ㅕ', 151 | 'ㅖ', 152 | 'ㅗ', 153 | 'ㅛ', 154 | 'ㅜ', 155 | 'ㅠ', 156 | 'ㅡ', 157 | 'ㅣ', 158 | ]; 159 | 160 | const keys = [ 161 | ['ㄱ', 'r'], 162 | ['ㄲ', 'R'], 163 | ['ㄴ', 's'], 164 | ['ㄷ', 'e'], 165 | ['ㄸ', 'E'], 166 | ['ㄹ', 'f'], 167 | ['ㅁ', 'a'], 168 | ['ㅂ', 'q'], 169 | ['ㅃ', 'Q'], 170 | ['ㅅ', 't'], 171 | ['ㅆ', 'T'], 172 | ['ㅇ', 'd'], 173 | ['ㅈ', 'w'], 174 | ['ㅉ', 'W'], 175 | ['ㅊ', 'c'], 176 | ['ㅋ', 'z'], 177 | ['ㅌ', 'x'], 178 | ['ㅍ', 'v'], 179 | ['ㅎ', 'g'], 180 | ['ㅏ', 'k'], 181 | ['ㅐ', 'o'], 182 | ['ㅑ', 'i'], 183 | ['ㅒ', 'O'], 184 | ['ㅓ', 'j'], 185 | ['ㅔ', 'p'], 186 | ['ㅕ', 'u'], 187 | ['ㅖ', 'P'], 188 | ['ㅗ', 'h'], 189 | ['ㅛ', 'y'], 190 | ['ㅜ', 'n'], 191 | ['ㅠ', 'b'], 192 | ['ㅡ', 'm'], 193 | ['ㅣ', 'l'], 194 | ]; 195 | -------------------------------------------------------------------------------- /lib/src/correct_postpositions.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/korea_regexp.dart'; 2 | 3 | List postPositions = [ 4 | ['은', '는'], 5 | ['이', '가'], 6 | ['을', '를'], 7 | ['과', '와'] 8 | ].fold>( 9 | [], 10 | (value, element) => [ 11 | ...value, 12 | [ 13 | RegExp('''([가-힣]['" ]{0,1})${element[0]}\\(${element[1]}\\)'''), 14 | element[0], 15 | element[1] 16 | ], 17 | [ 18 | RegExp('''([가-힣]['" ]{0,1})${element[1]}\\(${element[0]}\\)'''), 19 | element[0], 20 | element[1] 21 | ] 22 | ]); 23 | 24 | correctPostpositions(String text) { 25 | return postPositions.fold(text, (previousValue, element) { 26 | return previousValue.replaceAllMapped(element[0], (match) { 27 | return '${match[1]!.replaceAll(' ', '')}${getPhonemes(match[0]!).finale != '' ? element[1] : element[2]}'; 28 | }); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/eng_to_kor.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/constant.dart'; 2 | import 'package:korea_regexp/src/implode.dart'; 3 | 4 | final enToKr = { for (var e in keys) e.last : e.first }; 5 | 6 | String engToKor(String eng) { 7 | final kor = eng.split('').map((char) => enToKr[char] ?? char).join(); 8 | return implode(kor); 9 | } 10 | -------------------------------------------------------------------------------- /lib/src/escape_regexp.dart: -------------------------------------------------------------------------------- 1 | String reRegExpChar = '[\\^\$.*+?()[\]{}|]'; 2 | RegExp reHasRegExpChar = RegExp(reRegExpChar); 3 | 4 | escapeRegExp(String string) { 5 | return string.isNotEmpty && reHasRegExpChar.hasMatch(string) 6 | ? string.replaceAll(reRegExpChar, '\\\$&') 7 | : string; 8 | } 9 | -------------------------------------------------------------------------------- /lib/src/explode.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/constant.dart'; 2 | import 'package:korea_regexp/src/get_phonemes.dart'; 3 | import 'package:korea_regexp/src/models/phonemes_result.dart'; 4 | 5 | explode(String text, {bool grouped = false}) { 6 | List> accum = []; 7 | text.split('').forEach((char) { 8 | PhonemesResult phonemesResult = getPhonemes(char); 9 | List tempAccum = []; 10 | // 초성 중성 종성 중 하나라도 비는게 없는 경우 11 | if (phonemesResult.isNotEmpty) { 12 | tempAccum.add(phonemesResult.initial); 13 | (mixed[phonemesResult.medial] != null && 14 | !presentOnKeyboard.contains(phonemesResult.medial)) 15 | ? mixed[phonemesResult.medial]! 16 | .forEach((element) => tempAccum.add(element)) 17 | : tempAccum.add(phonemesResult.medial); 18 | (mixed[phonemesResult.finale] != null && 19 | !presentOnKeyboard.contains(phonemesResult.finale)) 20 | ? mixed[phonemesResult.finale]! 21 | .forEach((element) => tempAccum.add(element)) 22 | : tempAccum.add(phonemesResult.finale); 23 | 24 | tempAccum = tempAccum.where((element) => element != '').toList(); 25 | } else { 26 | tempAccum.add(char); 27 | } 28 | accum.add(tempAccum); 29 | }); 30 | 31 | return grouped ? accum : accum.expand((element) => element).toList(); 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /lib/src/get_phonemes.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/constant.dart'; 2 | import 'package:korea_regexp/src/models/phonemes_result.dart'; 3 | 4 | PhonemesResult getPhonemes(String char) { 5 | var initial = ''; 6 | var medial = ''; 7 | var finale = ''; 8 | 9 | var initialOffset = -1; 10 | var medialOffset = -1; 11 | var finaleOffset = -1; 12 | 13 | if (onlyInitialKoreanRegex.hasMatch(char)) { 14 | initial = char; 15 | initialOffset = initials.indexOf(initial); 16 | } else if (completedKoreanRegex.hasMatch(char)) { 17 | var temp = char.runes.first - base; 18 | finaleOffset = temp % finales.length; 19 | medialOffset = ((temp - finaleOffset) ~/ finales.length) % medials.length; 20 | initialOffset = ((temp - finaleOffset) ~/ finales.length - medialOffset) ~/ 21 | medials.length; 22 | initial = initials[initialOffset]; 23 | medial = medials[medialOffset]; 24 | finale = finales[finaleOffset]; 25 | } 26 | 27 | return PhonemesResult( 28 | initial: initial, 29 | initialOffset: initialOffset, 30 | medial: medial, 31 | medialOffset: medialOffset, 32 | finale: finale, 33 | finaleOffset: finaleOffset); 34 | } 35 | -------------------------------------------------------------------------------- /lib/src/get_regexp.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/constant.dart'; 2 | import 'package:korea_regexp/src/escape_regexp.dart'; 3 | import 'package:korea_regexp/src/get_phonemes.dart'; 4 | import 'package:korea_regexp/src/models/regexp_options.dart'; 5 | 6 | getInitialSearchRegExp(String initial, {bool allowOnlyInitial = false}) { 7 | var initialOffset = initials.indexOf(initial); 8 | if (initialOffset != -1) { 9 | var baseCode = initialOffset * medials.length * finales.length + base; 10 | return '[${allowOnlyInitial ? initial : ''}${String.fromCharCode(baseCode)}-${String.fromCharCode(baseCode + medials.length * finales.length - 1)}]'; 11 | } 12 | return initial; 13 | } 14 | 15 | var fuzzy = '__${int.parse('fuzzy', radix: 36)}__'; 16 | var ignoreSpace = '__${int.parse('ignorespace', radix: 36)}__'; 17 | 18 | getRegExp(String search, RegExpOptions options) { 19 | 20 | if (search.isEmpty) { 21 | if (options.emptyMatchAll) { 22 | return RegExp(''); 23 | } else { 24 | return RegExp('\\\$'); 25 | } 26 | } 27 | 28 | List frontChars = search.split(''); 29 | String? lastChar = frontChars[frontChars.length - 1]; 30 | String lastCharPattern = ''; 31 | 32 | var phonemes = getPhonemes(lastChar); 33 | 34 | // 마지막 글자가 한글인 경우만 수행 35 | if (phonemes.initialOffset != -1) { 36 | frontChars = frontChars.sublist(0, frontChars.length - 1); 37 | 38 | var baseCode = 39 | phonemes.initialOffset * medials.length * finales.length + base; 40 | List patterns = []; 41 | // 종성으로 끝나는 경우 ( 받침이 있는 경우) 42 | if (phonemes.finale != '') { 43 | patterns.add(lastChar); 44 | 45 | // 종성이 초성으로 사용 가능한 경우 46 | if (initials.contains(phonemes.finale)) { 47 | patterns.add( 48 | '${String.fromCharCode(baseCode + phonemes.medialOffset * finales.length)}${getInitialSearchRegExp(phonemes.finale)}'); 49 | } 50 | if (mixed[phonemes.finale] != null) { 51 | patterns.add( 52 | '${String.fromCharCode((baseCode + phonemes.medialOffset * finales.length + finales.join('').indexOf(mixed[phonemes.finale]![0])) + 1)}${getInitialSearchRegExp(mixed[phonemes.finale]![1])}'); 53 | } 54 | } else if (phonemes.medial != '') { 55 | int from, to; 56 | 57 | if (medialRange[phonemes.medial] != null) { 58 | from = baseCode + 59 | medials.join('').indexOf(medialRange[phonemes.medial]![0]) * 60 | finales.length; 61 | to = baseCode + 62 | medials.join('').indexOf(medialRange[phonemes.medial]![1]) * 63 | finales.length + 64 | finales.length - 65 | 1; 66 | } else { 67 | from = baseCode + phonemes.medialOffset * finales.length; 68 | to = from + finales.length - 1; 69 | } 70 | patterns.add('[${String.fromCharCode(from)}-${String.fromCharCode(to)}]'); 71 | } else if (phonemes.initial != '') { 72 | patterns.add( 73 | getInitialSearchRegExp(phonemes.initial, allowOnlyInitial: true)); 74 | } 75 | lastCharPattern = patterns.length > 1 76 | ? options.nonCaptureGroup 77 | ? '(?:${patterns.join('|')})' 78 | : '(${patterns.join('|')})' 79 | : patterns[0]; 80 | } 81 | 82 | var glue = options.fuzzy 83 | ? fuzzy 84 | : options.ignoreSpace 85 | ? ignoreSpace 86 | : ''; 87 | var frontCharsPattern = options.initialSearch 88 | ? frontChars 89 | .map((char) => (RegExp('[ㄱ-ㅎ]').hasMatch(char) 90 | ? getInitialSearchRegExp(char, allowOnlyInitial: true) 91 | : escapeRegExp(char))) 92 | .join(glue) 93 | : escapeRegExp(frontChars.join(glue)); 94 | var pattern = (options.startsWith ? '^' : '') + 95 | frontCharsPattern + 96 | glue + 97 | lastCharPattern + 98 | (options.endsWith ? '\$' : ''); 99 | 100 | if (glue != '') { 101 | pattern = pattern 102 | .replaceAll(RegExp(fuzzy), '.*') 103 | .replaceAll(RegExp(ignoreSpace), '\s*'); 104 | } 105 | return RegExp(pattern, caseSensitive: !options.ignoreCase); 106 | } 107 | -------------------------------------------------------------------------------- /lib/src/implode.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/constant.dart'; 2 | 3 | String implode(String input) { 4 | /// 인접한 모음을 하나의 복합 모음으로 합친다. 5 | final letters = mixMedial(input.split('')); 6 | 7 | /// 모음으로 시작하는 그룹들을 만든다. 8 | final createdGroups = createGroupsByMedial(letters); 9 | 10 | /// 각 그룹을 순회하면서 복합자음을 정리하고, 앞 그룹에서 종성으로 사용하고 남은 자음들을 초성으로 가져온다. 11 | final groups = 12 | mixFinaleAndReplaceTheRemainingFinalesToInitials(createdGroups); 13 | 14 | /// 각 글자에 해당하는 블록 단위로 나눈다. 15 | final blocks = groups.fold>>( 16 | [], (acc, group) => acc..addAll(divideByBlock(group))); 17 | 18 | return blocks.map(assemble).join(); 19 | } 20 | 21 | /// 인접한 모음을 하나의 복합 모음으로 합친다. 22 | List mixMedial(List inputs) { 23 | final chars = [inputs.first]; 24 | inputs.forEachFromNext((previous, current) { 25 | final mixedMedial = _findMixedMedial('$previous$current'); 26 | if (mixedMedial != null) { 27 | chars.last = mixedMedial; 28 | } else { 29 | chars.add(current); 30 | } 31 | }); 32 | return chars; 33 | } 34 | 35 | /// 모음으로 시작하는 그룹들을 만든다. 36 | List createGroupsByMedial(List chars) { 37 | var cursor = Group.empty(); 38 | final groups = [cursor]; 39 | for (var char in chars) { 40 | if (_isMedial(char)) { 41 | cursor = Group.fromMedial(char); 42 | groups.add(cursor); 43 | } else { 44 | cursor.finales.add(char); 45 | } 46 | } 47 | return groups; 48 | } 49 | 50 | /// 각 그룹을 순회하면서 종성의 복합자음을 정리하고, 앞 그룹에서 종성으로 사용하고 남은 자음들을 초성으로 가져온다. 51 | List mixFinaleAndReplaceTheRemainingFinalesToInitials( 52 | List groups) { 53 | final items = List.of(groups); 54 | items.forEachFromNext((prev, curr) { 55 | if (!prev.hasMedial || prev.finales.length == 1) { 56 | curr.initials = prev.finales; 57 | prev.finales = []; 58 | } else { 59 | curr.initials = prev.finales.skip(1).toList(); 60 | prev.finales = prev.finales.take(1).toList(); 61 | } 62 | 63 | const mixedFinaleLength = 2; 64 | const nextInitialMinimumLength = 1; 65 | if (curr.finales.length >= mixedFinaleLength + nextInitialMinimumLength || 66 | (curr == items.last && curr.finales.length >= mixedFinaleLength)) { 67 | final letters = curr.finales.take(mixedFinaleLength); 68 | final rest = curr.finales.skip(mixedFinaleLength); 69 | final mixedFinale = _findMixedFinale('${letters.first}${letters.last}'); 70 | if (mixedFinale != null) { 71 | curr.finales = [mixedFinale, ...rest]; 72 | } 73 | } 74 | }); 75 | return items; 76 | } 77 | 78 | /// 각 글자에 해당하는 블록 단위로 나눈다. 79 | List> divideByBlock(Group group) { 80 | final pre = List.of(group.initials); 81 | final initial = pre.isNotEmpty ? pre.removeLast() : ''; 82 | 83 | var post = group.finales; 84 | var finale = ''; 85 | if (post.isNotEmpty && _isFinale(post.first)) { 86 | finale = post.first; 87 | post = post.skip(1).toList(); 88 | } 89 | 90 | final blocks = >[]; 91 | blocks.addAll(pre.where((e) => e.isNotEmpty).map((e) => [e])); 92 | blocks 93 | .add([initial, group.medial, finale].where((e) => e.isNotEmpty).toList()); 94 | blocks.addAll(post.where((e) => e.isNotEmpty).map((e) => [e])); 95 | return blocks; 96 | } 97 | 98 | /// 올바른 음절 형식일 경우 합치고, 아닌 경우 문자열을 연결하여 리턴한다. 99 | String assemble(List block) { 100 | if (!block.any(_isMedial)) { 101 | return block.join(); 102 | } 103 | final syllableForm = createSyllableFormByMedial(block); 104 | final composition = Composition.from(syllableForm); 105 | if (!composition.isValid) { 106 | return block.join(); 107 | } 108 | return composition.toSyllable(); 109 | } 110 | 111 | /// 중성(최대 2개)을 기준으로 초성, 중성, 종성을 분리한다 112 | SyllableForm createSyllableFormByMedial(List block) { 113 | assert(block.any(_isMedial)); 114 | final medialIndex = block.indexWhere(_isMedial); 115 | final isMedialNext = 116 | medialIndex != block.length - 1 && _isMedial(block[medialIndex + 1]); 117 | final nextMedialIndex = isMedialNext ? medialIndex + 1 : medialIndex; 118 | final finaleIndex = nextMedialIndex + 1; 119 | 120 | final initial = block.sublist(0, medialIndex).join(); 121 | final medial = block.sublist(medialIndex, finaleIndex).join(); 122 | final finale = block.sublist(finaleIndex).join(); 123 | return SyllableForm(initial, medial, finale); 124 | } 125 | 126 | /// 해당 글자가 중성인지 127 | bool _isMedial(String? char) => medials.contains(char); 128 | 129 | /// 해당 글자가 종성인지 130 | bool _isFinale(String? char) => finales.contains(char); 131 | 132 | /// 두 모음을 합친 복합 중성이 있으면 그 글자를 리턴한다 133 | String? _findMixedMedial(String decomposedVowels) => 134 | _mixedMedial[decomposedVowels]; 135 | 136 | /// 두 자음을 합친 복합 종성이 있으면 그 글자를 리턴한다 137 | String? _findMixedFinale(String decomposedConsonants) => 138 | _mixedFinale[decomposedConsonants]; 139 | 140 | final _mixedMedial = _reversed(medialMixed); 141 | final _mixedFinale = _reversed(finaleMixed); 142 | 143 | Map _reversed(Map mixed) { 144 | return { 145 | for (var e in mixed.entries) e.value.join(): e.key, 146 | }; 147 | } 148 | 149 | class Group { 150 | List initials = []; 151 | final String medial; 152 | List finales = []; 153 | 154 | Group.fromMedial(this.medial); 155 | 156 | Group.empty() : this.fromMedial(''); 157 | 158 | bool get hasMedial => medial.isNotEmpty; 159 | 160 | @override 161 | String toString() => '$runtimeType($initials, $medial, $finales)'; 162 | } 163 | 164 | class SyllableForm { 165 | final String initial; 166 | final String medial; 167 | final String finale; 168 | 169 | const SyllableForm(this.initial, this.medial, this.finale); 170 | 171 | @override 172 | String toString() => '$runtimeType($initial, $medial, $finale)'; 173 | } 174 | 175 | /// 올바른 초성, 중성, 종성일 경우 하나의 한글 음절을 구할 수 있다. 176 | /// 177 | /// 계산식에 필요한 값은 [initials], [medials], [finales] 리스트에 알고리즘적으로 매핑되어 있다. 178 | /// for Example, 179 | /// ```dart 180 | /// var composition = Composition('ㅎ', 'ㅏ', 'ㄴ'); 181 | /// var syllable = composition.toSyllable(); // 한 182 | /// ``` 183 | /// 내부적으로 다음과 같이 계산된다. 184 | /// - 한 = ㅎ(18), ㅏ(0), ㄴ(4) = 44032 + [18 × 588 + 0 × 28 + 4] = 54620 185 | class Composition { 186 | final int initial; 187 | final int medial; 188 | final int finale; 189 | 190 | Composition.from(SyllableForm syllableForm) 191 | : this._(syllableForm.initial, syllableForm.medial, syllableForm.finale); 192 | 193 | Composition._(String initial, String medial, String finale) 194 | : initial = initials.indexOf(_findMixedFinale(initial) ?? initial), 195 | medial = medials.indexOf(_findMixedMedial(medial) ?? medial), 196 | finale = finales.indexOf(_findMixedFinale(finale) ?? finale); 197 | 198 | bool get isValid => initial != -1 && medial != -1; 199 | 200 | String toSyllable() => String.fromCharCode(_syllableCharCode()); 201 | 202 | int _syllableCharCode() { 203 | return base + 204 | initial * (medials.length * finales.length) + 205 | medial * finales.length + 206 | finale; 207 | } 208 | 209 | @override 210 | String toString() => '$runtimeType($initial, $medial, $finale)'; 211 | } 212 | 213 | extension ListX on List { 214 | void forEachFromNext(void Function(E previousValue, E element) f) { 215 | if (isEmpty) return; 216 | var previousValue = first; 217 | skip(1).forEach((element) { 218 | f(previousValue, element); 219 | previousValue = element; 220 | }); 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /lib/src/kor_to_eng.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/constant.dart'; 2 | import 'package:korea_regexp/src/explode.dart'; 3 | 4 | Map KR_TO_EN = 5 | Map.fromIterables(keys.map((e) => e[0]), keys.map((e) => e[1])); 6 | 7 | korToEng(String text) { 8 | return text 9 | .split('') 10 | .map((char) => 11 | (explode(char, grouped: false)).map((String e) => KR_TO_EN[e] ?? e)) 12 | .expand((element) => element) 13 | .toList() 14 | .join(''); 15 | } 16 | -------------------------------------------------------------------------------- /lib/src/models/phonemes_result.dart: -------------------------------------------------------------------------------- 1 | class PhonemesResult { 2 | final String initial; 3 | final String medial; 4 | final String finale; 5 | final int initialOffset; 6 | final int medialOffset; 7 | final int finaleOffset; 8 | 9 | bool get isNotEmpty => 10 | initialOffset != -1 || medialOffset != -1 || finaleOffset != -1; 11 | 12 | PhonemesResult( 13 | {this.initial = '', 14 | this.medial = '', 15 | this.finale = '', 16 | this.initialOffset = -1, 17 | this.medialOffset = -1, 18 | this.finaleOffset = -1}); 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/models/regexp_options.dart: -------------------------------------------------------------------------------- 1 | class RegExpOptions { 2 | final bool initialSearch; 3 | final bool startsWith; 4 | final bool endsWith; 5 | final bool ignoreSpace; 6 | final bool ignoreCase; 7 | final bool global; 8 | final bool fuzzy; 9 | final bool nonCaptureGroup; 10 | final bool emptyMatchAll; 11 | 12 | const RegExpOptions({ 13 | this.initialSearch = false, 14 | this.startsWith = false, 15 | this.endsWith = false, 16 | this.ignoreSpace = false, 17 | this.ignoreCase = false, 18 | this.global = false, 19 | this.fuzzy = false, 20 | this.nonCaptureGroup = false, 21 | this.emptyMatchAll = false, 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "64.0.0" 12 | analyzer: 13 | dependency: transitive 14 | description: 15 | name: analyzer 16 | sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "6.2.0" 20 | args: 21 | dependency: transitive 22 | description: 23 | name: args 24 | sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "2.4.2" 28 | async: 29 | dependency: transitive 30 | description: 31 | name: async 32 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "2.11.0" 36 | boolean_selector: 37 | dependency: transitive 38 | description: 39 | name: boolean_selector 40 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "2.1.1" 44 | collection: 45 | dependency: transitive 46 | description: 47 | name: collection 48 | sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.18.0" 52 | convert: 53 | dependency: transitive 54 | description: 55 | name: convert 56 | sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "3.1.1" 60 | coverage: 61 | dependency: transitive 62 | description: 63 | name: coverage 64 | sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "1.6.3" 68 | crypto: 69 | dependency: transitive 70 | description: 71 | name: crypto 72 | sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab 73 | url: "https://pub.dev" 74 | source: hosted 75 | version: "3.0.3" 76 | file: 77 | dependency: transitive 78 | description: 79 | name: file 80 | sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" 81 | url: "https://pub.dev" 82 | source: hosted 83 | version: "7.0.0" 84 | frontend_server_client: 85 | dependency: transitive 86 | description: 87 | name: frontend_server_client 88 | sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" 89 | url: "https://pub.dev" 90 | source: hosted 91 | version: "3.2.0" 92 | glob: 93 | dependency: transitive 94 | description: 95 | name: glob 96 | sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" 97 | url: "https://pub.dev" 98 | source: hosted 99 | version: "2.1.2" 100 | http_multi_server: 101 | dependency: transitive 102 | description: 103 | name: http_multi_server 104 | sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" 105 | url: "https://pub.dev" 106 | source: hosted 107 | version: "3.2.1" 108 | http_parser: 109 | dependency: transitive 110 | description: 111 | name: http_parser 112 | sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" 113 | url: "https://pub.dev" 114 | source: hosted 115 | version: "4.0.2" 116 | io: 117 | dependency: transitive 118 | description: 119 | name: io 120 | sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" 121 | url: "https://pub.dev" 122 | source: hosted 123 | version: "1.0.4" 124 | js: 125 | dependency: transitive 126 | description: 127 | name: js 128 | sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 129 | url: "https://pub.dev" 130 | source: hosted 131 | version: "0.6.7" 132 | lints: 133 | dependency: "direct dev" 134 | description: 135 | name: lints 136 | sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" 137 | url: "https://pub.dev" 138 | source: hosted 139 | version: "2.1.1" 140 | logging: 141 | dependency: transitive 142 | description: 143 | name: logging 144 | sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" 145 | url: "https://pub.dev" 146 | source: hosted 147 | version: "1.2.0" 148 | matcher: 149 | dependency: transitive 150 | description: 151 | name: matcher 152 | sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" 153 | url: "https://pub.dev" 154 | source: hosted 155 | version: "0.12.16" 156 | meta: 157 | dependency: transitive 158 | description: 159 | name: meta 160 | sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e 161 | url: "https://pub.dev" 162 | source: hosted 163 | version: "1.10.0" 164 | mime: 165 | dependency: transitive 166 | description: 167 | name: mime 168 | sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e 169 | url: "https://pub.dev" 170 | source: hosted 171 | version: "1.0.4" 172 | node_preamble: 173 | dependency: transitive 174 | description: 175 | name: node_preamble 176 | sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" 177 | url: "https://pub.dev" 178 | source: hosted 179 | version: "2.0.2" 180 | package_config: 181 | dependency: transitive 182 | description: 183 | name: package_config 184 | sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" 185 | url: "https://pub.dev" 186 | source: hosted 187 | version: "2.1.0" 188 | path: 189 | dependency: transitive 190 | description: 191 | name: path 192 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" 193 | url: "https://pub.dev" 194 | source: hosted 195 | version: "1.8.3" 196 | pool: 197 | dependency: transitive 198 | description: 199 | name: pool 200 | sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" 201 | url: "https://pub.dev" 202 | source: hosted 203 | version: "1.5.1" 204 | pub_semver: 205 | dependency: transitive 206 | description: 207 | name: pub_semver 208 | sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" 209 | url: "https://pub.dev" 210 | source: hosted 211 | version: "2.1.4" 212 | shelf: 213 | dependency: transitive 214 | description: 215 | name: shelf 216 | sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 217 | url: "https://pub.dev" 218 | source: hosted 219 | version: "1.4.1" 220 | shelf_packages_handler: 221 | dependency: transitive 222 | description: 223 | name: shelf_packages_handler 224 | sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" 225 | url: "https://pub.dev" 226 | source: hosted 227 | version: "3.0.2" 228 | shelf_static: 229 | dependency: transitive 230 | description: 231 | name: shelf_static 232 | sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e 233 | url: "https://pub.dev" 234 | source: hosted 235 | version: "1.1.2" 236 | shelf_web_socket: 237 | dependency: transitive 238 | description: 239 | name: shelf_web_socket 240 | sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" 241 | url: "https://pub.dev" 242 | source: hosted 243 | version: "1.0.4" 244 | source_map_stack_trace: 245 | dependency: transitive 246 | description: 247 | name: source_map_stack_trace 248 | sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" 249 | url: "https://pub.dev" 250 | source: hosted 251 | version: "2.1.1" 252 | source_maps: 253 | dependency: transitive 254 | description: 255 | name: source_maps 256 | sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" 257 | url: "https://pub.dev" 258 | source: hosted 259 | version: "0.10.12" 260 | source_span: 261 | dependency: transitive 262 | description: 263 | name: source_span 264 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 265 | url: "https://pub.dev" 266 | source: hosted 267 | version: "1.10.0" 268 | stack_trace: 269 | dependency: transitive 270 | description: 271 | name: stack_trace 272 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 273 | url: "https://pub.dev" 274 | source: hosted 275 | version: "1.11.1" 276 | stream_channel: 277 | dependency: transitive 278 | description: 279 | name: stream_channel 280 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 281 | url: "https://pub.dev" 282 | source: hosted 283 | version: "2.1.2" 284 | string_scanner: 285 | dependency: transitive 286 | description: 287 | name: string_scanner 288 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 289 | url: "https://pub.dev" 290 | source: hosted 291 | version: "1.2.0" 292 | term_glyph: 293 | dependency: transitive 294 | description: 295 | name: term_glyph 296 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 297 | url: "https://pub.dev" 298 | source: hosted 299 | version: "1.2.1" 300 | test: 301 | dependency: "direct dev" 302 | description: 303 | name: test 304 | sha256: "9b0dd8e36af4a5b1569029949d50a52cb2a2a2fdaa20cebb96e6603b9ae241f9" 305 | url: "https://pub.dev" 306 | source: hosted 307 | version: "1.24.6" 308 | test_api: 309 | dependency: transitive 310 | description: 311 | name: test_api 312 | sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" 313 | url: "https://pub.dev" 314 | source: hosted 315 | version: "0.6.1" 316 | test_core: 317 | dependency: transitive 318 | description: 319 | name: test_core 320 | sha256: "4bef837e56375537055fdbbbf6dd458b1859881f4c7e6da936158f77d61ab265" 321 | url: "https://pub.dev" 322 | source: hosted 323 | version: "0.5.6" 324 | typed_data: 325 | dependency: transitive 326 | description: 327 | name: typed_data 328 | sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c 329 | url: "https://pub.dev" 330 | source: hosted 331 | version: "1.3.2" 332 | vm_service: 333 | dependency: transitive 334 | description: 335 | name: vm_service 336 | sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 337 | url: "https://pub.dev" 338 | source: hosted 339 | version: "11.10.0" 340 | watcher: 341 | dependency: transitive 342 | description: 343 | name: watcher 344 | sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" 345 | url: "https://pub.dev" 346 | source: hosted 347 | version: "1.1.0" 348 | web_socket_channel: 349 | dependency: transitive 350 | description: 351 | name: web_socket_channel 352 | sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b 353 | url: "https://pub.dev" 354 | source: hosted 355 | version: "2.4.0" 356 | webkit_inspection_protocol: 357 | dependency: transitive 358 | description: 359 | name: webkit_inspection_protocol 360 | sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" 361 | url: "https://pub.dev" 362 | source: hosted 363 | version: "1.2.1" 364 | yaml: 365 | dependency: transitive 366 | description: 367 | name: yaml 368 | sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" 369 | url: "https://pub.dev" 370 | source: hosted 371 | version: "3.1.2" 372 | sdks: 373 | dart: ">=3.0.0 <4.0.0" 374 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: korea_regexp 2 | description: It is a package that makes it easier to handle Korean by using regular expressions. 정규표현식을 이용해 한국어를 더 쉽게 다룰 수 있게 해주는 패키지입니다. 3 | version: 1.2.1 4 | repository : https://github.com/jpoh281/flutter_korea_regexp 5 | 6 | environment: 7 | sdk: ">=3.0.0 <4.0.0" 8 | 9 | dev_dependencies: 10 | test: ^1.24.6 11 | lints: ^2.0.1 12 | 13 | -------------------------------------------------------------------------------- /test/correct_postpositions_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/correct_postpositions.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main(){ 5 | for (var element in [ 6 | ['전쟁와(과) 평화', '전쟁과 평화'], 7 | ['죄와(과) 벌', '죄와 벌'], 8 | ['설탕은(는) 달다', '설탕은 달다'], 9 | ['고양이은(는) 건드리지 마라', '고양이는 건드리지 마라'], 10 | ['홍길동이(가) 홍상직을(를) 만났다', '홍길동이 홍상직을 만났다'], 11 | ['토끼이(가) 거북이을(를) 만났다', '토끼가 거북이를 만났다'], 12 | ['''"토끼"이(가) '거북이'을(를) 만났다''', '''"토끼"가 '거북이'를 만났다'''], 13 | ['고양이 은(는) 건드리지 마라', '고양이는 건드리지 마라'], 14 | ]) { 15 | test('correctPostpositions ${element[0]} => ${element[1]}', (){ 16 | expect(correctPostpositions(element[0]), element[1]); 17 | } 18 | ); 19 | } 20 | } -------------------------------------------------------------------------------- /test/eng_to_kor_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/eng_to_kor.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | main() { 5 | group('engToKor', () { 6 | for (var e in [ 7 | ['gksrmfskf', '한글날'], 8 | ['Rkrenrl, xhdekfr', '깍두기, 통닭'], 9 | ]) { 10 | final before = e.first; 11 | final after = e.last; 12 | test('engToKor $before → $after', () { 13 | expect(engToKor(before), after); 14 | }); 15 | } 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /test/explode_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/korea_regexp.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main(){ 5 | for (var element in [ 6 | ['가까가', ['ㄱ', 'ㅏ', 'ㄲ', 'ㅏ', 'ㄱ', 'ㅏ']], 7 | ['깍두기', ['ㄲ', 'ㅏ', 'ㄱ', 'ㄷ', 'ㅜ', 'ㄱ', 'ㅣ']], 8 | ['불닭', ['ㅂ', 'ㅜ', 'ㄹ', 'ㄷ', 'ㅏ', 'ㄹ', 'ㄱ']], 9 | ['왜요', ['ㅇ', 'ㅗ', 'ㅐ', 'ㅇ', 'ㅛ']], 10 | ['있', ['ㅇ','ㅣ','ㅆ']], 11 | ['씼', ['ㅆ','ㅣ','ㅆ']], 12 | ]) { 13 | test('explode', () { 14 | expect(explode(element[0] as String), element[1]); 15 | }); 16 | } 17 | test('grouped: true', () { 18 | expect(explode('불닭', grouped: true), [ 19 | ['ㅂ', 'ㅜ', 'ㄹ'], 20 | ['ㄷ', 'ㅏ', 'ㄹ', 'ㄱ'], 21 | ]); 22 | }); 23 | } -------------------------------------------------------------------------------- /test/get_phonemes_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/korea_regexp.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main (){ 5 | List> getPhonemesTest = [ 6 | ['ㄱ', ['ㄱ', '', '']], 7 | ['가', ['ㄱ', 'ㅏ', '']], 8 | ['각', ['ㄱ', 'ㅏ', 'ㄱ']], 9 | ['ㅎ', ['ㅎ', '', '']], 10 | ['히', ['ㅎ', 'ㅣ', '']], 11 | ['힣', ['ㅎ', 'ㅣ', 'ㅎ']], 12 | ['뷁', ['ㅂ', 'ㅞ', 'ㄺ']], 13 | ]; 14 | for (var element in getPhonemesTest) { 15 | var char = element[0]; 16 | var initial = element[1][0]; 17 | var medial = element[1][1]; 18 | var finale = element[1][2]; 19 | var phonemes = getPhonemes(char); 20 | test('getPhonemesTest', () { 21 | expect(phonemes.initial, initial); 22 | expect(phonemes.medial, medial); 23 | expect(phonemes.finale, finale); 24 | }); 25 | } 26 | } -------------------------------------------------------------------------------- /test/get_reg_exp_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/korea_regexp.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main(){ 5 | for (var e in [ 6 | ['대한민ㄱ', '대한민[ㄱ가-깋]'], 7 | ['대한민구', '대한민[구-귛]'], 8 | ['대한민국', '대한민(국|구[가-깋])'], 9 | ['온라이', '온라[이-잏]'], 10 | ['깎', '(깎|까[까-낗]|깍[가-깋])'], 11 | ['뷁', '(뷁|뷀[가-깋])'], 12 | ['korea', 'korea'], 13 | ]) { 14 | test('getRegExp ${e[0]} → ${e[1]}', 15 | () => {expect(getRegExp(e[0], RegExpOptions()), RegExp(e[1]))}); 16 | } 17 | 18 | test( 19 | 'initialSearch: false (default)', 20 | () => { 21 | expect(getRegExp('ㅎㄱ', RegExpOptions(initialSearch: false)), 22 | getRegExp('ㅎㄱ', RegExpOptions(initialSearch: false))), 23 | expect(getRegExp('ㅎㄱ', RegExpOptions(initialSearch: false)), 24 | RegExp('ㅎ[ㄱ가-깋]')), 25 | expect(getRegExp('^ㅎㄱ\$', RegExpOptions(initialSearch: false)), 26 | RegExp('^ㅎㄱ\$')) 27 | }); 28 | 29 | test( 30 | 'initialSearch: true', 31 | () => { 32 | expect(getRegExp('ㅎㄱ', RegExpOptions(initialSearch: true)), 33 | RegExp('[ㅎ하-힣][ㄱ가-깋]')), 34 | expect(getRegExp('^ㅎㄱ\$', RegExpOptions(initialSearch: true)), 35 | RegExp('^[ㅎ하-힣][ㄱ가-깋]\$')) 36 | }); 37 | 38 | test( 39 | 'startsWith: false', 40 | () => { 41 | expect(getRegExp('ㅎㄱ', RegExpOptions(startsWith: false)), 42 | getRegExp('ㅎㄱ', RegExpOptions(startsWith: false))), 43 | expect(getRegExp('ㅎㄱ', RegExpOptions(startsWith: false)), 44 | RegExp('ㅎ[ㄱ가-깋]')), 45 | expect(getRegExp('^ㅎㄱ\$', RegExpOptions(startsWith: false)), 46 | RegExp('^ㅎㄱ\$')) 47 | }); 48 | 49 | test( 50 | 'startsWith: true', 51 | () => { 52 | expect(getRegExp('ㅎㄱ', RegExpOptions(startsWith: true)), 53 | RegExp('^ㅎ[ㄱ가-깋]')), 54 | expect(getRegExp('^ㅎㄱ\$', RegExpOptions(startsWith: true)), 55 | RegExp('^\^ㅎㄱ\$')) 56 | }); 57 | 58 | test( 59 | 'endsWith: false', 60 | () { 61 | expect(getRegExp('ㅎㄱ', RegExpOptions(endsWith: false)), 62 | getRegExp('ㅎㄱ', RegExpOptions(endsWith: false))); 63 | expect(getRegExp('ㅎㄱ', RegExpOptions(endsWith: false)), 64 | RegExp('ㅎ[ㄱ가-깋]')); 65 | expect(getRegExp('^ㅎㄱ\$', RegExpOptions(endsWith: false)), 66 | RegExp('^ㅎㄱ\$')); 67 | }); 68 | 69 | test( 70 | 'endsWith: true', 71 | () { 72 | expect(getRegExp('ㅎㄱ', RegExpOptions(endsWith: true)), 73 | RegExp('ㅎ[ㄱ가-깋]\$')); 74 | expect(getRegExp('^ㅎㄱ\$', RegExpOptions(endsWith: true)), 75 | RegExp('^ㅎㄱ\$\$')); 76 | }); 77 | 78 | test( 79 | 'ignoreSpace: false', 80 | () { 81 | expect(getRegExp('한글날', RegExpOptions(ignoreSpace: false)), 82 | getRegExp('한글날', RegExpOptions(ignoreSpace: false))); 83 | expect(getRegExp('한글날', RegExpOptions(ignoreSpace: false)), 84 | RegExp('한글(날|나[라-맇])')); 85 | }); 86 | 87 | test( 88 | 'ignoreSpace: true', 89 | () { 90 | expect(getRegExp('한글날', RegExpOptions(ignoreSpace: true)), 91 | RegExp('한\s*글\s*(날|나[라-맇])')); 92 | }); 93 | 94 | test( 95 | 'ignoreCase: false', 96 | () { 97 | expect(getRegExp('ㅎㄱ', RegExpOptions(ignoreCase: false)), 98 | getRegExp('ㅎㄱ', RegExpOptions(ignoreCase: false))); 99 | expect(getRegExp('ㅎㄱ', RegExpOptions(ignoreCase: false)), 100 | RegExp('ㅎ[ㄱ가-깋]')); 101 | }); 102 | 103 | test( 104 | 'ignoreCase: true', 105 | () { 106 | expect(getRegExp('ㅎㄱ', RegExpOptions(ignoreCase: true)), 107 | RegExp('ㅎ[ㄱ가-깋]', caseSensitive: false)); 108 | }); 109 | 110 | RegExp fuzzyFalse = 111 | getRegExp('ㅋㅍ', RegExpOptions(initialSearch: true, fuzzy: false)); 112 | List words = ['카페', '카카오페이', '카페오레', '카메라', '아카펠라']; 113 | List matched1 = words.where((e) => fuzzyFalse.hasMatch(e)).toList(); 114 | test( 115 | 'fuzzy: false', 116 | () { 117 | expect(matched1, ['카페', '카페오레', '아카펠라']); 118 | }); 119 | 120 | RegExp fuzzyTrue = 121 | getRegExp('ㅋㅍ', RegExpOptions(initialSearch: true, fuzzy: true)); 122 | List matched2 = words.where((e) => fuzzyTrue.hasMatch(e)).toList(); 123 | test( 124 | 'fuzzy: true', 125 | () { 126 | expect(matched2, ['카페', '카카오페이', '카페오레', '아카펠라']); 127 | }); 128 | 129 | test('nonCaptureGroup: false (default)', () { 130 | expect(getRegExp('한글날', RegExpOptions(nonCaptureGroup: false)), RegExp('한글(날|나[라-맇])')); 131 | }); 132 | 133 | test('nonCaptureGroup: true', () { 134 | expect(getRegExp('한글날', RegExpOptions(nonCaptureGroup: true)), RegExp('한글(?:날|나[라-맇])')); 135 | }); 136 | 137 | test('emptyMatchAll: false (default)', () { 138 | expect(getRegExp('', RegExpOptions(emptyMatchAll: false)), RegExp('\\\$')); 139 | }); 140 | 141 | test('emptyMatchAll: true (default)', () { 142 | expect(getRegExp('', RegExpOptions(emptyMatchAll: true)), RegExp('')); 143 | }); 144 | } 145 | -------------------------------------------------------------------------------- /test/implode_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/src/implode.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | main() { 5 | group('implode', () { 6 | for (var e in [ 7 | ['ㄲㅏㄱㄷㅜㄱㅣ', '깍두기'], 8 | ['ㄲㅏㄱㄱㄷㅜㄱㅣ', '깎두기'], 9 | ['ㅂㅜㄹㄷㅏㄹㄱ', '불닭'], 10 | ['ㅂㅜㄹㄷㅏㄹㄱㅇㅡㄴ', '불닭은'], 11 | ['ㅇㅓㅂㅔㄴㅈㅕㅅㅡ ㅇㅐㄴㄷㅡㄱㅔㅇㅣㅁ', '어벤져스 앤드게임'], 12 | ]) { 13 | final hints = e.first; 14 | final text = e.last; 15 | test('implode $hints → $text', () { 16 | expect(implode(hints), text); 17 | }); 18 | } 19 | }); 20 | 21 | group('mixMedial', () { 22 | test('ㅗㅏ -> ㅘ', () { 23 | expect(mixMedial(['ㅇ', 'ㅗ', 'ㅏ']), ['ㅇ', 'ㅘ']); 24 | }); 25 | test('합칠 수 있는 복합 모음이 없는 경우 변경 사항이 없다', () { 26 | expect(mixMedial(['ㅇ', 'ㅣ', 'ㅇ']), ['ㅇ', 'ㅣ', 'ㅇ']); 27 | }); 28 | test('복합 자음은 합치지 않는다', () { 29 | expect(mixMedial(['ㅂ', 'ㅏ', 'ㄱ', 'ㄱ']), ['ㅂ', 'ㅏ', 'ㄱ', 'ㄱ']); 30 | expect(mixMedial(['ㅅ', 'ㅅ', 'ㅏ', 'ㄹ']), ['ㅅ', 'ㅅ', 'ㅏ', 'ㄹ']); 31 | }); 32 | }); 33 | 34 | group('createGroupsByMedial', () { 35 | test('모음을 기준으로 `Groups`을 생성한다', () { 36 | final groups = createGroupsByMedial(['ㄱ', 'ㅡ', 'ㄹ', 'ㅐ']); 37 | 38 | final group1 = groups[0]; 39 | expect(group1.finales, ['ㄱ']); 40 | 41 | final group2 = groups[1]; 42 | expect(group2.medial, 'ㅡ'); 43 | expect(group2.finales, ['ㄹ']); 44 | 45 | final group3 = groups[2]; 46 | expect(group3.medial, 'ㅐ'); 47 | }); 48 | }); 49 | 50 | group('앞 그룹에서 종성으로 사용하고 남은 자음들을 초성으로 가져오는 로직 테스트', () { 51 | test( 52 | '앞 그룹에 중성이 없는 경우,' 53 | '앞 그룹의 모든 종성을 현재 그룹의 초성으로 가져온다', () { 54 | //given 55 | final previous = Group.empty()..finales = ['ㄱ', 'ㄱ']; 56 | final current = Group.fromMedial('ㅏ'); 57 | //when 58 | final groups = 59 | mixFinaleAndReplaceTheRemainingFinalesToInitials([previous, current]); 60 | //then 61 | final previousActual = groups.first; 62 | final currentActual = groups.last; 63 | expect(previousActual.finales, isEmpty); 64 | expect(currentActual.initials, ['ㄱ', 'ㄱ']); 65 | }); 66 | test( 67 | '앞 그룹에 중성이 있고 종성은 1개인 경우,' 68 | '앞 그룹의 모든 종성을 현재 그룹의 초성으로 가져온다', () { 69 | //given 70 | final previous = Group.fromMedial('ㅗ')..finales = ['ㄱ']; 71 | final current = Group.fromMedial('ㅏ'); 72 | //when 73 | final groups = 74 | mixFinaleAndReplaceTheRemainingFinalesToInitials([previous, current]); 75 | //then 76 | final previousActual = groups.first; 77 | final currentActual = groups.last; 78 | expect(previousActual.finales, isEmpty); 79 | expect(currentActual.initials, ['ㄱ']); 80 | }); 81 | test( 82 | '앞 그룹에 중성이 있고 종성이 여러 개인 경우,' 83 | '앞 그룹의 종성을 1개만 남기고 모두 현재 그룹의 초성으로 가져온다', () { 84 | //given 85 | final previous = Group.fromMedial('ㅗ')..finales = ['ㄱ', 'ㄴ', 'ㄷ']; 86 | final current = Group.fromMedial('ㅏ'); 87 | //when 88 | final groups = 89 | mixFinaleAndReplaceTheRemainingFinalesToInitials([previous, current]); 90 | //then 91 | final previousActual = groups.first; 92 | final currentActual = groups.last; 93 | expect(previousActual.finales, ['ㄱ']); 94 | expect(currentActual.initials, ['ㄴ', 'ㄷ']); 95 | }); 96 | }); 97 | 98 | group('복합자음 정리 로직 테스트', () { 99 | test('현재 그룹의 종성이 3개 이상이면 복합자음을 정리한다', () { 100 | //given 101 | final previous = Group.empty(); 102 | final current = Group.fromMedial('ㅏ')..finales = ['ㄱ', 'ㄱ', 'ㄱ']; 103 | //when 104 | final groups = 105 | mixFinaleAndReplaceTheRemainingFinalesToInitials([previous, current]); 106 | //then 107 | expect(groups.last.finales, ['ㄲ', 'ㄱ']); 108 | }); 109 | test('현재 그룹이 리스트의 마지막 요소이면 종성이 2개 이상일 때 복합자음을 정리한다', () { 110 | //given 111 | final previous = Group.empty(); 112 | final current = Group.fromMedial('ㅏ')..finales = ['ㄱ', 'ㄱ']; 113 | //when 114 | final groups = 115 | mixFinaleAndReplaceTheRemainingFinalesToInitials([previous, current]); 116 | //then 117 | expect(current, equals(groups.last)); 118 | expect(groups.last.finales, ['ㄲ']); 119 | }); 120 | test('복합자음이 유효하지 않으면 정리되지 않는다', () { 121 | //given 122 | final previous = Group.empty(); 123 | final current = Group.fromMedial('ㅏ')..finales = ['ㅋ', 'ㅎ']; 124 | //when 125 | final groups = 126 | mixFinaleAndReplaceTheRemainingFinalesToInitials([previous, current]); 127 | //then 128 | expect(groups.last.finales, ['ㅋ', 'ㅎ']); 129 | }); 130 | test('복합모음은 정리되지 않는다', () { 131 | //given 132 | final previous = Group.empty(); 133 | final current = Group.fromMedial('ㅗㅏ'); 134 | //when 135 | final groups = 136 | mixFinaleAndReplaceTheRemainingFinalesToInitials([previous, current]); 137 | //then 138 | expect(groups.last.medial, 'ㅗㅏ'); 139 | }); 140 | }); 141 | 142 | group('divideByBlock', () { 143 | test('`Group initials`의 마지막 글자만 초성으로 사용된다', () { 144 | final group = Group.fromMedial('ㅗ') 145 | ..initials = ['ㅇ', 'ㄲ'] 146 | ..finales = ['ㅊ']; 147 | expect(divideByBlock(group), [ 148 | ['ㅇ'], 149 | ['ㄲ', 'ㅗ', 'ㅊ'] 150 | ]); 151 | }); 152 | test('`Group finales`의 첫번째 글자만 종성으로 사용된다', () { 153 | final group = Group.fromMedial('ㅗ') 154 | ..initials = ['ㄲ'] 155 | ..finales = ['ㅊ', 'ㅇ']; 156 | expect(divideByBlock(group), [ 157 | ['ㄲ', 'ㅗ', 'ㅊ'], 158 | ['ㅇ'] 159 | ]); 160 | }); 161 | test('`Group finales`의 첫번째 글자가 유효하지 않으면 종성으로 사용되지 않는다', () { 162 | final group = Group.fromMedial('ㅗ') 163 | ..initials = ['ㄲ'] 164 | ..finales = ['s', 'ㅊ']; 165 | expect(divideByBlock(group), [ 166 | ['ㄲ', 'ㅗ'], 167 | ['s'], 168 | ['ㅊ'] 169 | ]); 170 | }); 171 | test('초성은 유효성 검사를 하지 않고 사용된다', () { 172 | final group = Group.fromMedial('ㅗ') 173 | ..initials = ['ㄲ', 's'] 174 | ..finales = ['ㅊ']; 175 | expect(divideByBlock(group), [ 176 | ['ㄲ'], 177 | ['s', 'ㅗ', 'ㅊ'] 178 | ]); 179 | }); 180 | test('빈 값인 경우 빈 배열을 리턴한다', () { 181 | final group = Group.empty(); 182 | expect(divideByBlock(group), [[]]); 183 | }); 184 | test('빈 문자열인 경우 빈 배열을 리턴한다', () { 185 | final group = Group.empty() 186 | ..initials = [''] 187 | ..finales = ['']; 188 | expect(divideByBlock(group), [[]]); 189 | }); 190 | }); 191 | 192 | group('assemble', () { 193 | test('올바른 음절 형식인 경우 합친 하나의 음절을 리턴한다', () { 194 | expect(assemble(['ㄲ', 'ㅗ', 'ㅊ']), '꽃'); 195 | }); 196 | test('종성이 없는 경우 연결된 문자열을 리턴한다', () { 197 | expect(assemble(['ㅇ', 'ㅇ', 'ㅇ']), 'ㅇㅇㅇ'); 198 | }); 199 | test('올바른 음절 형식이 아닌 경우 연결된 문자열을 리턴한다', () { 200 | expect(assemble(['ㄽ', 'ㅗ', 'ㅇ']), 'ㄽㅗㅇ'); 201 | }); 202 | }); 203 | 204 | group('createSyllableFormByMedial', () { 205 | test('문자열에서 초성, 중성, 종성을 분리한다', () { 206 | final block = createSyllableFormByMedial(['ㄲ', 'ㅗ', 'ㅊ']); 207 | expect(block.initial, 'ㄲ'); 208 | expect(block.medial, 'ㅗ'); 209 | expect(block.finale, 'ㅊ'); 210 | }); 211 | test('중성이 2글자 이상이어도 2글자만 중성으로 분리된다', () { 212 | final block = createSyllableFormByMedial(['ㅇ', 'ㅜ', 'ㅣ', 'ㅜ', 'ㅣ']); 213 | expect(block.initial, 'ㅇ'); 214 | expect(block.medial, 'ㅜㅣ'); 215 | expect(block.finale, 'ㅜㅣ'); 216 | }); 217 | }); 218 | 219 | group('Composition', () { 220 | test('올바른 음절 형식인경우 toSyllable()는 하나의 한글 음절을 리턴한다', () { 221 | final form = SyllableForm('ㄲ', 'ㅗ', 'ㅊ'); 222 | expect(Composition.from(form).toSyllable(), '꽃'); 223 | }); 224 | test('초성이 유효하지 않으면 isValid는 false를 리턴한다', () { 225 | final form = SyllableForm('ㄽ', 'ㅗ', 'ㅇ'); 226 | expect(Composition.from(form).isValid, false); 227 | }); 228 | test('중성이 유효하지 않으면 isValid는 false를 리턴한다', () { 229 | final form = SyllableForm('ㄹ', 'ㄹ', 'ㅇ'); 230 | expect(Composition.from(form).isValid, false); 231 | }); 232 | test('종성은 isValid에서 유효성 검사를 하지 않는다', () { 233 | final form = SyllableForm('ㄹ', 'ㅗ', 'ㅗ'); 234 | expect(Composition.from(form).isValid, isNot(false)); 235 | }); 236 | test('복합 초성를 한번 더 합친다', () { 237 | final form = SyllableForm('ㄱㄱ', 'ㅗ', 'ㅊ'); 238 | expect(Composition.from(form).toSyllable(), '꽃'); 239 | }); 240 | test('복합 중성를 한번 더 합친다', () { 241 | final form = SyllableForm('ㅇ', 'ㅜㅣ', ''); 242 | expect(Composition.from(form).toSyllable(), '위'); 243 | }); 244 | test('복합 종성를 한번 더 합친다', () { 245 | final form = SyllableForm('ㅇ', 'ㅣ', 'ㅅㅅ'); 246 | expect(Composition.from(form).toSyllable(), '있'); 247 | }); 248 | test('하지만 초성에서 ㄸ, ㅃ와 같은 복합 자모는 합치지 못한다', () { 249 | final form = SyllableForm('ㄷㄷ', 'ㅣ', ''); 250 | expect(Composition.from(form).toSyllable(), isNot('띠')); 251 | }); 252 | }); 253 | } 254 | -------------------------------------------------------------------------------- /test/kor_to_eng_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:korea_regexp/korea_regexp.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main(){ 5 | for (var element in [ 6 | ['ㅗ디ㅣㅐ 재깅!', 'hello world!'], 7 | ['ㅠㅁ차 새 솓 려셕ㄷ', 'back to the future'], 8 | ]) { 9 | test('korToEng', () { 10 | expect(korToEng(element[0]), element[1]); 11 | }); 12 | } 13 | } -------------------------------------------------------------------------------- /test/korea_regexp_test.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | 3 | } 4 | --------------------------------------------------------------------------------