项目作者: mydictionary-project

项目描述 :
It is a cross-platform CLI desktop application of excel-based and online dictionaries with MYDICTIONARY.
高级语言: Go
项目地址: git://github.com/mydictionary-project/mydictionary-demo.git
创建时间: 2017-06-13T04:15:08Z
项目社区:https://github.com/mydictionary-project/mydictionary-demo

开源协议:Apache License 2.0

下载


MYDICTIONARY Demo

简体中文

1. Introduction

It is a cross-platform CLI desktop application of excel-based and online dictionaries with MYDICTIONARY.

2. Release

Get executable files for different platforms from here.

3. Manual

The most important thing should be emphasized 3 time at first:

  • Press “*“ and “enter” to quit.
  • Press “*“ and “enter” to quit.
  • Press “*“ and “enter” to quit.

Also, for better comprehension, please read basic information at first.

3.1. Configure File

Before using the application, configuration files in JSON should be edited.

Such files could be modified by any editors of plain text, such as “Notepad” (for Windows) and “TextEdit” (for macOS).

Users could also use JSON Editor Online to edit them:

  1. Open the default configuration file.
  2. Copy the content to the left part of the webpage.
  3. Click the right arrow, the content will be parsed in the right part.
  4. Edit things in the right part.
  5. Click the left arrow, the content will be updated.
  6. Copy the content to the configuration file.
  7. Save the configuration file.
3.1.1. Configure File “mydictionary.setting.json”

Getting further information from here.

3.1.2. Configure File “mydictionary-local-cli.setting.json”

Here is an example:

  1. {
  2. "autoSaveFile": {
  3. "enable": true,
  4. "timeIntervalSecond": 600,
  5. "notification": true
  6. }
  7. }

When the application launches, collection files and dictionary files are copied to corresponding collections and dictionaries (RAM images). When the application exits, collections and dictionaries are written back to corresponding collection files and dictionary files. By doing this, the application can record vocabularies in RAM, which provides high running efficiency.

But here is a problem: if the application aborts, all vocabularies recorded by this run will lose forever. To prevent this, the application is able to automatically write back data to files.

"autoSaveFile" is designed to control the action of writing back. It has got 3 members.

  • Boolean "enable": If it is true, the action is enabled.
  • Integer "timeIntervalSecond": it determines the time interval (second) between two actions.
  • Boolean "notification": if it is true, the application will display the information when the action happen.

3.2. Launch

Before launching the application, all collection files and dictionary files should not be used by any other applications, like Microsoft Excel or WPS表格.

If the application launches successfully, users will see this:

  1. (... bash ...) $ ./mydictionary-local-cli
  2. [2017-06-06 15:24:54]
  3. mydictionary-local
  4. [2017-06-06 15:24:54]
  5. (... the content of file "mydictionary-local-cli.setting.json" ...)
  6. [2017-06-06 15:24:54]
  7. mydictionary
  8. [2017-06-06 15:24:54]
  9. (... the content of file "mydictionary.setting.json" ...)
  10. [2017-06-06 15:24:55]
  11. (... the result of network checking ...)
  12. [2017-06-06 15:24:55]
  13. ready
  14. TIPS: press "*" and "enter" to quit at any time

At this time, the application is ready.

If there is something wrong, the application will display the reason and quit, like this:

  1. [2017-06-06 17:31:47]
  2. incorrect format of file "(... path ...)/data/animal.xlsx": missing cell "Word" in row 1
  3. [2017-06-06 17:31:47]
  4. Quit (press "enter" to continue).

3.3. Query

Here is a typical query:

  1. apple!@#
  2. // the word with option users input
  3. ============================================================
  4. apple (advance, online, do not record)
  5. // the word with option
  6. ------------------------------------------------------------
  7. * BASIC
  8. // query type, "BASIC" or "ADVANCE"
  9. apple
  10. [fruit: 1] (0)
  11. // for collection or dictionary, [name: serious number] (query counter)
  12. n. 苹果公司;【植】苹果;【植】苹果树
  13. 网络 苹果电脑;美国苹果;美国苹果公司
  14. // define(s)
  15. # Since the meeting takes place on Apple's property, the company has every right to make the rules.
  16. # 由于会议地点在苹果公司,公司完全有权利制定规则。
  17. // note(s)
  18. apple
  19. [Merriam Webster]
  20. // for service, [name]
  21. noun
  22. : a round fruit with red, yellow, or green skin and firm white flesh
  23. apple
  24. [Bing Dictionary]
  25. n. 苹果公司;【植】苹果;【植】苹果树
  26. 网络 苹果电脑;美国苹果;美国苹果公司
  27. apple
  28. [iCIBA Collins]
  29. 01 N-VAR 苹果
  30. An apple is a round fruit with smooth green, yellow, or red skin and firm white flesh.
  31. 02 PHRASE 心肝宝贝;掌上明珠
  32. If you say that someone is the apple of your eye, you mean that they are very important to you and you are extremely fond of them.
  33. ============================================================
3.3.1. Basic Query

If users input a word and press “enter”, the application will execute basic query.

Getting further information about basic query and advance query from here.

  1. cat
  2. ============================================================
  3. cat
  4. ------------------------------------------------------------
  5. * BASIC
  6. cat
  7. [animal: 1] (1)
  8. n. 【动】猫;【动】猫科动物;爵士乐爱好者;【船】起锚滑车
  9. v. 【船】把(锚)吊放在锚架上;宿娼;〈口〉呕吐;〈俚〉寻欢
  10. abbr. (=computerized axial tomography)【医】计算机化轴向层面X射线摄影法
  11. 网络 卡特(Carter);过氧化氢酶(catalase);卡特彼勒(Caterpillar)
  12. # The cat sat in front of the bird cage in an agony of frustration at being so near and yet so far.
  13. # 猫无可奈何地坐在鸟笼前,眼看着鸟儿近在咫尺,可怎么也够不着。
  14. ============================================================
  15. apple
  16. ============================================================
  17. apple
  18. ------------------------------------------------------------
  19. * BASIC
  20. apple
  21. [fruit: 1] (1)
  22. n. 苹果公司;【植】苹果;【植】苹果树
  23. 网络 苹果电脑;美国苹果;美国苹果公司
  24. # Since the meeting takes place on Apple's property, the company has every right to make the rules.
  25. # 由于会议地点在苹果公司,公司完全有权利制定规则。
  26. ============================================================
  27. frustration
  28. ============================================================
  29. frustration
  30. ------------------------------------------------------------
  31. * BASIC
  32. frustration
  33. [Merriam Webster]
  34. noun
  35. : a feeling of anger or annoyance caused by being unable to do something : the state of being frustrated
  36. : something that causes feelings of anger and annoyance
  37. : the fact of being prevented from succeeding or doing something
  38. frustration
  39. [Bing Dictionary]
  40. n. 沮丧;受挫;挫败;懊丧
  41. 网络 挫折;失败;挫折感
  42. frustration
  43. [iCIBA Collins]
  44. 01 VERB 使灰心;使沮丧;使愤怒
  45. If something frustrates you, it upsets or angers you because you are unable to do anything about the problems it creates.
  46. 02 VERB 挫败;阻挠…的成功
  47. If someone or something frustrates a plan or attempt to do something, they prevent it from succeeding.
  48. ============================================================
3.3.2. Advance Query

If users input a word with ! or , the application will execute advanced query.

  1. frustration!
  2. ============================================================
  3. frustration (advance)
  4. ------------------------------------------------------------
  5. * BASIC
  6. frustration
  7. [bing-dictionary: 1] (2)
  8. n. 沮丧;受挫;挫败;懊丧
  9. 网络 挫折;失败;挫折感
  10. frustration
  11. [iciba-collins: 1] (2)
  12. 01 VERB 使灰心;使沮丧;使愤怒
  13. If something frustrates you, it upsets or angers you because you are unable to do anything about the problems it creates.
  14. 02 VERB 挫败;阻挠…的成功
  15. If someone or something frustrates a plan or attempt to do something, they prevent it from succeeding.
  16. frustration
  17. [merriam-webster: 1] (2)
  18. noun
  19. : a feeling of anger or annoyance caused by being unable to do something : the state of being frustrated
  20. : something that causes feelings of anger and annoyance
  21. : the fact of being prevented from succeeding or doing something
  22. ------------------------------------------------------------
  23. * ADVANCE
  24. cat
  25. [animal: 1] (1)
  26. n. 【动】猫;【动】猫科动物;爵士乐爱好者;【船】起锚滑车
  27. v. 【船】把(锚)吊放在锚架上;宿娼;〈口〉呕吐;〈俚〉寻欢
  28. abbr. (=computerized axial tomography)【医】计算机化轴向层面X射线摄影法
  29. 网络 卡特(Carter);过氧化氢酶(catalase);卡特彼勒(Caterpillar)
  30. # The cat sat in front of the bird cage in an agony of frustration at being so near and yet so far.
  31. # 猫无可奈何地坐在鸟笼前,眼看着鸟儿近在咫尺,可怎么也够不着。
  32. ============================================================
3.3.3. Online Query

If users input a word with @, it will let the application know that users need query the word online.

Whether the application queries the word online also depends on online.mode in configuration file mydictionary.setting.json. Getting further information from here.

  1. apple@
  2. ============================================================
  3. apple (online)
  4. ------------------------------------------------------------
  5. * BASIC
  6. apple
  7. [fruit: 1] (2)
  8. n. 苹果公司;【植】苹果;【植】苹果树
  9. 网络 苹果电脑;美国苹果;美国苹果公司
  10. # Since the meeting takes place on Apple's property, the company has every right to make the rules.
  11. # 由于会议地点在苹果公司,公司完全有权利制定规则。
  12. apple
  13. [Merriam Webster]
  14. noun
  15. : a round fruit with red, yellow, or green skin and firm white flesh
  16. apple
  17. [Bing Dictionary]
  18. n. 苹果公司;【植】苹果;【植】苹果树
  19. 网络 苹果电脑;美国苹果;美国苹果公司
  20. apple
  21. [iCIBA Collins]
  22. 01 N-VAR 苹果
  23. An apple is a round fruit with smooth green, yellow, or red skin and firm white flesh.
  24. 02 PHRASE 心肝宝贝;掌上明珠
  25. If you say that someone is the apple of your eye, you mean that they are very important to you and you are extremely fond of them.
  26. ============================================================
3.3.4. Do Not Record

If users input a word with #, the application will not record anything to collections and dictionaries.

  1. apple#
  2. ============================================================
  3. apple (do not record)
  4. ------------------------------------------------------------
  5. * BASIC
  6. apple
  7. [fruit: 1] (2)
  8. n. 苹果公司;【植】苹果;【植】苹果树
  9. 网络 苹果电脑;美国苹果;美国苹果公司
  10. # Since the meeting takes place on Apple's property, the company has every right to make the rules.
  11. # 由于会议地点在苹果公司,公司完全有权利制定规则。
  12. ============================================================

3.4. Exit

Press “*“ and “enter” to quit. Otherwise, collections and dictionaries will not be written back to corresponding collection files and dictionary files, which means all changes will lose.

  1. *
  2. [2017-06-06 15:45:57]
  3. (... the information of writing back ...)
  4. [2017-06-06 15:45:57]
  5. Quit.
  6. (... bash ...) $

4. Communication

5. Others

  • All code files are edited by Atom.
  • All “.md” files are edited by Typora.
  • The style of all “.md” files is Github Flavored Markdown.
  • There is a LF (Linux) at the end of each line.