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

Commit 72d5857

Browse files
authored
Merge pull request #146 from isalgueiro/galician
Galician
2 parents a725f89 + 54efea8 commit 72d5857

56 files changed

Lines changed: 1272 additions & 32767 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Galician dictionary extracted from [Galipedia articles dump](https://dumps.wikimedia.org/glwiki/20180220/).
2+
3+
Galician flag image from [Wikipedia](htt ps://en.wikipedia.org/wiki/Galicia_(Spain)#/media/File:Flag_of_Galicia.svg)
4+
15
This is the common template for language Packs for the [AnySoftKeyboard](https://github.com/AnySoftKeyboard/AnySoftKeyboard) app for Android devices.
26
Each pack can contain and provide multiple keyboards or dictionaries for auto correction.
37
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:
@@ -18,15 +22,15 @@ To start a new pack, follow this checklist:
1822
1. Change `applicationId` in `build.gradle` in the same way.
1923
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.
2024
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.
21-
1. Edit `src/main/res/xml/dictionaries.xml`
25+
1. Edit `src/main/res/xml/dictionariesfor.xml`
2226
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.
2327
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).
2428
1. Rebuild the drawables with `./gradlew svgToDrawablePng` or "Build" -> "Rebuild Project" in Android Studio. Drawables will be generated at `src/main/res/mipmap-*/`.
2529
1. Choose whether you like the standard or the broad variant and set that as application's `android:icon` in `src/main/AndroidManifest.xml`.
2630
1. You can also add a new `src/main/res/drawable/flag.png` and reference it in the `iconResId=""` attribute in the keyboards.xml.
2731
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.
2832
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)):
29-
* `GenerateWordsListTask`
33+
* `GenerateWordsListTask`mergeAllWordLists
3034
* `GenerateWordsListFromAOSPTask`
3135
* `MergeWordsListTask`
3236
1. Change the README.md to reflect the characteristics of your pack

build.gradle

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ buildscript {
1414
google()
1515
jcenter()
1616
mavenCentral()
17+
google()
1718
maven { url 'https://jitpack.io' }
1819
maven { url "https://plugins.gradle.org/m2/" }
1920
}
2021
dependencies {
21-
classpath 'com.android.tools.build:gradle:3.1.0-beta4'
22+
classpath 'com.android.tools.build:gradle:3.1.0'
2223

2324
classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:makedictionary:287fe7812294918636359e4d28dbcbc931f3dab8'
2425
classpath 'com.github.AnySoftKeyboard.AnySoftKeyboardTools:generatewordslist:287fe7812294918636359e4d28dbcbc931f3dab8'
@@ -55,7 +56,7 @@ android {
5556
buildToolsVersion '27.0.3'
5657

5758
defaultConfig {
58-
applicationId "com.anysoftkeyboard.languagepack.languagepack"
59+
applicationId "com.anysoftkeyboard.languagepack.galician"
5960
minSdkVersion 9
6061
targetSdkVersion 27
6162
versionName versionData.versionName
@@ -95,19 +96,16 @@ play {
9596
uploadImages = true
9697
}
9798

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

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

113111
task mergeAllWordLists(type: MergeWordsListTask) {

checkstyle/checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
</module>
9494

9595
<module name="RegexpSingleline">
96-
<property name="format" value="com.anysoftkeyboard.languagepack.languagepack" />
96+
<property name="format" value="com.anysoftkeyboard.languagepack.galician" />
9797
<property name="message"
9898
value="You should create a new package id for your language pack, and not 'com.anysoftkeyboard.languagepack.languagepack'." />
9999
</module>

dictionary/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
glwiki-20180220-pages-articles.txt

0 commit comments

Comments
 (0)