Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #146 from isalgueiro/galician
Browse files Browse the repository at this point in the history
Galician
  • Loading branch information
friesenkiwi authored Jun 1, 2018
2 parents a725f89 + 54efea8 commit 72d5857
Show file tree
Hide file tree
Showing 56 changed files with 1,272 additions and 32,767 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Galician dictionary extracted from [Galipedia articles dump](https://dumps.wikimedia.org/glwiki/20180220/).

Galician flag image from [Wikipedia](htt ps://en.wikipedia.org/wiki/Galicia_(Spain)#/media/File:Flag_of_Galicia.svg)

This is the common template for language Packs for the [AnySoftKeyboard](https://github.com/AnySoftKeyboard/AnySoftKeyboard) app for Android devices.
Each pack can contain and provide multiple keyboards or dictionaries for auto correction.
Most packs are maintained here as [branches of the repository](https://github.com/AnySoftKeyboard/LanguagePack/branches) and published to Google Play Store and F-Droid repository. There are some packs maintained as community forks, here on GitHub or not open source at all. Some of these are:
Expand All @@ -18,15 +22,15 @@ To start a new pack, follow this checklist:
1. Change `applicationId` in `build.gradle` in the same way.
1. Edit `src/main/res/xml/keyboards.xml` according to the comments in it. It references `src/main/res/xml/qwerty.xml`, so edit this as well. Have a look at all the other Language Pack branches, to get an idea, what is possible and how to correctly configure a keyboard.
1. If you want to add more keyboards, you can do this by copying `qwerty.xml` and add a <keyboard> element in `keyboards.xml`. The user can pre-select in the ASK settings, which keyboards she would like to have available for toggling through.
1. Edit `src/main/res/xml/dictionaries.xml`
1. Edit `src/main/res/xml/dictionariesfor.xml`
1. Edit `src/main/res/values/strings.xml`, change the strings there and possibly add some more which are referenced in the other xml files. Also, create a new folder `src/main/res/values-XX`, where `XX` is the correspondent two-letter ISO 639-1 language code.
1. Edit (e.g. via Inkscape) one of the files in `src/main/svg-png/flag/` to represent the language, e.g. by using the flag from Wikipedia (the flag has to be placed on the right edge of the document and have the full height).
1. Rebuild the drawables with `./gradlew svgToDrawablePng` or "Build" -> "Rebuild Project" in Android Studio. Drawables will be generated at `src/main/res/mipmap-*/`.
1. Choose whether you like the standard or the broad variant and set that as application's `android:icon` in `src/main/AndroidManifest.xml`.
1. You can also add a new `src/main/res/drawable/flag.png` and reference it in the `iconResId=""` attribute in the keyboards.xml.
1. Put the source files for the dictionary into the dictionary/ directory. Take special care to take the conditions of the license into account, under which you obtained the data.
1. Change the build.gradle to use and configure the tasks necessary. There are several different variants ([more Information](https://github.com/AnySoftKeyboard/AnySoftKeyboardTools/blob/master/README.md)):
* `GenerateWordsListTask`
* `GenerateWordsListTask`mergeAllWordLists
* `GenerateWordsListFromAOSPTask`
* `MergeWordsListTask`
1. Change the README.md to reflect the characteristics of your pack
Expand Down
24 changes: 11 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ buildscript {
google()
jcenter()
mavenCentral()
google()
maven { url 'https://jitpack.io' }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0-beta4'
classpath 'com.android.tools.build:gradle:3.1.0'

classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:makedictionary:287fe7812294918636359e4d28dbcbc931f3dab8'
classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:generatewordslist:287fe7812294918636359e4d28dbcbc931f3dab8'
Expand Down Expand Up @@ -55,7 +56,7 @@ android {
buildToolsVersion '27.0.3'

defaultConfig {
applicationId "com.anysoftkeyboard.languagepack.languagepack"
applicationId "com.anysoftkeyboard.languagepack.galician"
minSdkVersion 9
targetSdkVersion 27
versionName versionData.versionName
Expand Down Expand Up @@ -95,19 +96,16 @@ play {
uploadImages = true
}

task parseTextInputFiles(type: GenerateWordsListTask) {
inputFiles new File(project.getProjectDir(), "dictionary/NY_STATE_ASSEMBLY_TRANSCRIPT_20120621.txt"),
//Download the archive from https://dumps.wikimedia.org/other/static_html_dumps/current/simple/
new File(project.getProjectDir(), "dictionary/First_English_Civil_War_Wikipedia.htm")
outputWordsListFile new File(project.getProjectDir(), "dictionary/words_from_texts.xml")
task uncompressTextFiles(type:Exec) {
commandLine "bunzip2", "-k", "-f", "dictionary/glwiki-20180220-pages-articles.txt.bz2"
}

//another option is to download the words-list from AOSP at https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/master/dictionaries/
//make sure that you are using an unzipped file. The XX_wordlist.combined file should be a plain text file.
task parseAospForEnglishDictionary(type: GenerateWordsListFromAOSPTask) {
inputFile new File(project.getProjectDir(), "dictionary/aosp_en_wordlist.combined")
outputWordsListFile new File(project.getProjectDir(), "dictionary/words_from_aosp.xml")
maxWordsInList 300000
task parseTextInputFiles(type: GenerateWordsListTask) {
dependsOn uncompressTextFiles
inputFiles new File(project.getProjectDir(), "dictionary/glwiki-20180220-pages-articles.txt")
outputWordsListFile new File(project.getProjectDir(), "dictionary/words_from_texts.xml")
locale new Locale("gl", "ES")
wordCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÁáÉéÍíÓóÚúÜüÑñÇç".toCharArray()
}

task mergeAllWordLists(type: MergeWordsListTask) {
Expand Down
2 changes: 1 addition & 1 deletion checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
</module>

<module name="RegexpSingleline">
<property name="format" value="com.anysoftkeyboard.languagepack.languagepack" />
<property name="format" value="com.anysoftkeyboard.languagepack.galician" />
<property name="message"
value="You should create a new package id for your language pack, and not 'com.anysoftkeyboard.languagepack.languagepack'." />
</module>
Expand Down
1 change: 1 addition & 0 deletions dictionary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
glwiki-20180220-pages-articles.txt
Loading

0 comments on commit 72d5857

Please sign in to comment.