class App { - String configFileName; - ArrayList<LocalDict> registeredLocalDicts; - ArrayList<OnlineDict> registeredOnlineDicts; + {static} Database db; + {static} Properties configs; - void loadConfigs() + String getConfigFileName() + void setConfigFileName(String configFileName) + ArrayList<Dict> getRegisteredDicts() + ArrayList<LocalDict> getRegisteredLocalDicts() + ArrayList<OnlineDict> getRegisteredOnlineDicts() + void initializeTables() + boolean hasTables() + void insertValuesIntoDictTypes() + void registerDicts() + void registerDict() } abstract class Dict { - String name; - String shortName; - String description; - DictType type; + String getName() + String getShortName() + String getDescription() + DictType getType() + void setName(String name) + void setShortName(String shortName) + void setDescription(String description) + void setType(DictType type) + {static} String preProcessWordSpell(String wordSpell) {abstract} Word queryWord(String wordSpell); } enum DictType { Online Local } abstract class OnlineDict { + OnlineDict(String name, String shortName, String description) {abstract} Word queryWord(String wordSpell) } abstract class LocalDict { - Instant atime; - Instant mtime; - {static} Database db = App.db; - {static} boolean updateWordAccess; + LocalDict(String name, String shortName, String description) + Instant getAtime() + Instant getMtime() + void updateAtime() + void updateMtime() + void initializeTables() + void dropTables() + boolean hasTables() + Word queryWord(String wordSpell) + void addWord(Word word) + void deleteWord(String wordSpell) + void updateWord(Word word) + void updateWordAccess(Word word) + void updateWordModify(Word word) + void updateWordforms(Word word, ArrayList<stirng> wordForms) + void updateWordFrequency(Word word, Frequency wordFrequency) + void updateWordPronounce(Word word, Pronounce pronounce) + void updateWordSource(Word word, String wordSource) + void updateWordSenseEntries(Word word, ArrayList<SenseEntry> wordSenseEntryList, boolean appendMode) + int size() {abstract} void build(); } class DefaultLocalDict { - {static} String name = "Default local dictionary"; - {static} String shortName = "def"; - {static} String description = "the default local dictionary" + void build() } class MITDict { - {static} String name = "MIT Englinsh Dictionary"; - {static} String shortName = "mit"; - {static} String description = "Word list is from MIT..." + void build(); } class CollinsOnlineDict { - {static} String name = "Collins Online English Dictionary"; - {static} String shortName = "collins"; - {static} String description = "English to English" - {static} String queryUrlBase = "...url" + Word queryWord(String wordSpell); } class Word { - String spell; - ArrayList<String> forms; - Frequency frequency; - Pronounce pronounce; - ArrayList<SenseEntry> senseEntryList; - String source = ""; - Instant mtime; - Instant atime; - int acounter = 0; + Word clone() + String toString() + boolean equals(Object otherObj) + boolean isEmpty() + String getSpell(); + Pronounce getPronounce(); + String getfrequency(); + ArrayList<String> getforms(); + ArrayList<SenseEntry> getSenseEntries() + Instant getMtime() + Instant getAtime() + Instant getSource() + void setSpell(); + void setPronounce(); + void setfrequency(); + void setforms(); + void setSenseEntries(); + void setSource() + void updateMtime() + void updateAtime() + void combine(SenseEntry other) + {static} ArrayList<SenseEntry> noDuplicatedSense(ArrayList<SenseEntry> senseEntryList) } class Pronounce { - String soundmark; - String[] sound; + Pronounce clone() + String toString() + boolean equals() } class SenseEntry { - String wordClass; - String sense; - ArrayList<String> examples; + SenseEntry clone() + String toString() + boolean equals() + void combine(SenseEntry other) + {static} ArrayList<SenseEntry> noDuplicatedSense(ArrayList<SenseEntry> senseEntryList) } class Frequency { - String band; - String description; + Frequency clone() + String toString() + boolean equals() } class Formatter { - Word word + Wrod getWord() + void setWord(Word word) + void printText() + void printColorText() + String toAnki() } class Printer { + {static} void toTerminal(String formattedWord) } class Extractor { - String input; + {static} Word collinsOnline() } class Request { - String proxyHost; - int proxyPort = -1; - boolean redirect = true; - int maxRedirect = 5; - int redirectCounter = 0; - Duration timeout = Duration.ofSeconds(5); - HttpClient client; - HttpRequest.Builder requestBuilder; - HttpResponse.BodyHandler bodyHandler; - String url; + void loadConfigs() + void initializeClient() + void setUrlIntoRequestBuilder() + HttpResponse<String> get() } class Database { - String dbms; - String dbName; - String userName; - String password; - String urlString; - String driver; - String serverName; - int portNumber; - Connection currentCon; + void getConnectionUseDbName() + void useDbName() + void getConnection() + void closeConnection() + boolean isConnected() + Connection getCurrentConUseDbName() + Connection getCurrentCon() + void createTable(String creatTableStr) + void addForeignKey(String addForeignKeyStr) + void dropTable(String dropTableStr) + void createDatabase() + void loadConfigs() + {static} void printSQLException(SQLException e) + {static} bolean ignoreSQLException(String sqlState) + {static} void getWarningsFromResultSet(ResultSet rs) + {static} void getWarningsFromStatement(ResultSet rs) + {static} printWarnings(SQLWarning warning) } Dict <|.. LocalDict Dict <|.. OnlineDict LocalDict <|.. DefaultLocalDict LocalDict <|.. MITDict OnlineDict <|.. CollinsOnlineDict Word *-- Pronounce Word *-- SenseEntry : sensenEntrylist MITDict o-- Word DefaultLocalDict o-- Word Database -- App App -- Dict CollinsOnlineDict <-- Request Request <-- Extractor Extractor <-- Word Word <-- Formatter Formatter <-- Printer