Skip to content

Commit

Permalink
feat: #81 #102 Move NonStandardDictionary to kg-common and conver…
Browse files Browse the repository at this point in the history
…t it to Kotlin.
  • Loading branch information
dmitry-weirdo committed Nov 25, 2024
1 parent 8239c58 commit 013f49c
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion kgCommon/src/main/kotlin/ru/klavogonki/common/Car.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ru.klavogonki.common
/**
* List of cars with ids and Russian names.
*/
@SuppressWarnings("MagicNumber")
@Suppress("MagicNumber")
enum class Car(
@JvmField val id: Int,
@JvmField val displayName: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package ru.klavogonki.kgparser;

import ru.klavogonki.common.DictionaryUtils;
package ru.klavogonki.common

/**
* Популярные нестандартные словари.
*/
public enum NonStandardDictionary {

@Suppress("MagicNumber", "Unused")
enum class NonStandardDictionary(
@JvmField val code: String,
@JvmField val displayName: String,
@JvmField val displayNamePrepositional: String
) {
// most popular non-standard dictionaries
NORMAL_IN_ENGLISH(5539, "Обычный in English", "Обычном in English"),
ONE_HUNDRED_RUSSIAN(25856, "Соточка", "Соточке"),
Expand Down Expand Up @@ -50,7 +52,7 @@ public enum NonStandardDictionary {
HRUST_EXERCISE_21(32013, "Упражнение №21", "Упражнении №21"),
HRUST_EXERCISE_22(32014, "Упражнение №22", "Упражнении №22"),
HRUST_EXERCISE_23(32015, "Упражнение №23", "Упражнении №23"),
// HRUST_EXERCISE_24(32016, "Упражнение №24", "Упражнении №24"),
// HRUST_EXERCISE_24(32016, "Упражнение №24", "Упражнении №24"),
HRUST_EXERCISE_24(32016, "Упражнение заключительное", "Упражнении заключительном"),

// Мультилингва
Expand All @@ -60,18 +62,13 @@ public enum NonStandardDictionary {
// номера словарей по возрастанию: normal 5539 8950 25130 29236 29464 29468 29510 29513 29521 29537 29616 29667 30395 30641 35239 40559 106181 106487 106554 106688 114083 114825 115209 115378 115424 115943 116073 116553 116554 116745 117862 122698 122702 122761 122888 122891 123163 130272 136302 136354 136403 136795 136908 137357 138500 141412 141415 141423 141609 141610 141960
;


NonStandardDictionary(final int code, final String displayName, final String displayNamePrepositional) {
this(DictionaryUtils.NON_STANDARD_DICTIONARY_ID_PREFIX + code, displayName, displayNamePrepositional);
}

NonStandardDictionary(final String code, final String displayName, final String displayNamePrepositional) {
this.code = code;
this.displayName = displayName;
this.displayNamePrepositional = displayNamePrepositional;
}

public final String code;
public final String displayName;
public final String displayNamePrepositional;
}
constructor(
code: Int,
displayName: String,
displayNamePrepositional: String
) : this(
DictionaryUtils.getDictionaryCode(code),
displayName,
displayNamePrepositional
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ru.klavogonki.common
/**
* Энум с названиями стандартных словарей (режимов), как они используются в AJAX-API.
*/
@SuppressWarnings("MagicNumber", "LongParameterList")
@Suppress("MagicNumber", "LongParameterList")
enum class StandardDictionary(

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ru.klavogonki.statistics.export.vocabulary.non_standard;

import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.VocabularyTopExporter;
import ru.klavogonki.statistics.export.vocabulary.VocabularyTopUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import ru.klavogonki.kgparser.NonStandardDictionary;
import ru.klavogonki.common.NonStandardDictionary;
import ru.klavogonki.statistics.export.vocabulary.standard.NonStandardVocabularyTopExporterDefaultImpl;
import ru.klavogonki.statistics.springboot.Profiles;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ru.klavogonki.statistics.export.vocabulary

import org.apache.logging.log4j.kotlin.Logging
import ru.klavogonki.common.NonStandardDictionary
import ru.klavogonki.common.StandardDictionary
import ru.klavogonki.kgparser.NonStandardDictionary
import ru.klavogonki.statistics.excel.ExcelExporter

@Suppress("TooManyFunctions")
Expand Down

0 comments on commit 013f49c

Please sign in to comment.