1

Deleting dead code, updating README

Former-commit-id: 680131f5b7ea0dc78ac7d2585fbbf4c0a07aa720
This commit is contained in:
Alex Yatskov 2015-11-13 18:33:13 +09:00
parent 7c986fe38b
commit 0640fd4be8
12 changed files with 16 additions and 25 deletions

View File

@ -20,20 +20,20 @@ plugin that (unless you disabled it in options) will notify you when new version
1. Make sure you are running the latest version of Anki. 1. Make sure you are running the latest version of Anki.
2. Open your vocab deck and note the fields that are used in your deck. 2. Open your vocab deck and note the fields that are used in your deck.
![Card layout dialog](http://foosoft.net/projects/yomichan/img/layout.png) [![Card layout dialog](img/layout-thumb.png)](img/layout.png)
3. Launch Yomichan from the tools menu inside Anki. 3. Launch Yomichan from the tools menu inside Anki.
4. Open the text file you want and you will see its contents in the Yomichan. Your layout and color scheme will look 4. Open the text file you want and you will see its contents in the Yomichan. Your layout and color scheme will look
different because the screenshot shows my personal settings. different because the screenshot shows my personal settings.
![Reader dialog](http://foosoft.net/projects/yomichan/img/reader.png) [![Reader dialog](img/reader-thumb.png)](img/reader.png)
5. To look up words hover your mouse over them while pressing the middle mouse button (usually this is your scroll 5. To look up words hover your mouse over them while pressing the middle mouse button (usually this is your scroll
wheel). You can also press and hold shift instead if you like (or your mouse has no center button). wheel). You can also press and hold shift instead if you like (or your mouse has no center button).
6. To set up your Anki deck for Yomichan select Preferences from the Edit menu and you should see a screen that looks 6. To set up your Anki deck for Yomichan select Preferences from the Edit menu and you should see a screen that looks
like this: like this:
![Preferences dialog](http://foosoft.net/projects/yomichan/img/preferences.png) [![Preferences dialog](img/preferences-thumb.png)](img/preferences.png)
7. Now you should add markers such as `{expression}`, `{reading}`, `{reading}` and `{sentence}` to specify how new 7. Now you should add markers such as `{expression}`, `{reading}`, `{reading}` and `{sentence}` to specify how new
cards should be created. Card fields will vary depending on your deck model. cards should be created. Card fields will vary depending on your deck model.
@ -42,7 +42,7 @@ plugin that (unless you disabled it in options) will notify you when new version
Anki thinks you can't add a fact with those items*. This likely means that they would either be duplicates of Anki thinks you can't add a fact with those items*. This likely means that they would either be duplicates of
existing cards in the deck or that Yomichan hasn't been properly set up for your deck model. existing cards in the deck or that Yomichan hasn't been properly set up for your deck model.
![Icons](http://foosoft.net/projects/yomichan/img/icons.png) [![Icons](img/icons-thumb.png)](img/icons.png)
Here is what the icons mean (in order from left to right): Here is what the icons mean (in order from left to right):
* Add term in Kana form even it can be written in Kanji (e.g. べんきょうか). * Add term in Kana form even it can be written in Kanji (e.g. べんきょうか).
@ -53,14 +53,14 @@ plugin that (unless you disabled it in options) will notify you when new version
By request, I've added several keyboard shortcuts which make Yomichan even easier to use: By request, I've added several keyboard shortcuts which make Yomichan even easier to use:
| Shortcut | Command | | Shortcut | Command |
|------------------------|-----------------------------------------------------| |-----------------------------|-----------------------------------------------------|
| `Shift` | Search under cursor | | <kbd>Shift</kbd> | Search under cursor |
| `]` | Move search cursor forwards | | <kbd>]</kbd> | Move search cursor forwards |
| `[` | Move search cursor backwards | | <kbd>[</kbd> | Move search cursor backwards |
| `Shift` + `Ctrl` + `#` | Add current Kanji at index 0 - 9 to deck | | <kbd>Shift + Ctrl + #</kbd> | Add current Kanji at index 0 - 9 to deck |
| `Ctrl` + `#` | Add current term at index 0 - 9 to deck | | <kbd>Ctrl + #</kbd> | Add current term at index 0 - 9 to deck |
| `Alt` + `#` | Add current term at index 0 - 9 to deck as Hiragana | | <kbd>Alt + #</kbd> | Add current term at index 0 - 9 to deck as Hiragana |
## Importing Vocabulary ## ## Importing Vocabulary ##

BIN
img/icons-thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
img/icons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
img/layout-thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
img/layout.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
img/preferences-thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
img/preferences.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
img/reader-thumb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
img/reader.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 KiB

View File

@ -105,7 +105,7 @@ class DialogPreferences(QtGui.QDialog, gen.preferences_ui.Ui_DialogPreferences):
self.comboBoxModel.blockSignals(False) self.comboBoxModel.blockSignals(False)
allowedTags = { allowedTags = {
'vocab': ['expression', 'reading', 'glossary', 'sentence', 'translation'], 'vocab': ['expression', 'reading', 'glossary', 'sentence'],
'kanji': ['character', 'onyomi', 'kunyomi', 'glossary'], 'kanji': ['character', 'onyomi', 'kunyomi', 'glossary'],
}[name] }[name]

View File

@ -507,10 +507,9 @@ class MainWindowReader(QtGui.QMainWindow, gen.reader_ui.Ui_MainWindowReader):
lengthMatched = 0 lengthMatched = 0
if self.dockVocab.isVisible(): if self.dockVocab.isVisible():
self.state.vocabDefs, lengthMatched = self.language.findTerm(contentSampleFlat) self.state.vocabDefs, lengthMatched = self.language.findTerm(contentSampleFlat)
sentence, translation = reader_util.findSentence(content, samplePosStart) sentence = reader_util.findSentence(content, samplePosStart)
for definition in self.state.vocabDefs: for definition in self.state.vocabDefs:
definition['sentence'] = sentence definition['sentence'] = sentence
definition['translation'] = translation
self.updateVocabDefs() self.updateVocabDefs()
if self.dockKanji.isVisible(): if self.dockKanji.isVisible():

View File

@ -78,14 +78,8 @@ def findSentence(content, position):
quoteStack.pop() quoteStack.pop()
elif c in quotesFwd: elif c in quotesFwd:
quoteStack.insert(0, quotesFwd[c]) quoteStack.insert(0, quotesFwd[c])
translation = ''
translationStart = content.find('\t',end) return content[start:end].strip()
if translationStart >= 0:
translationEnd = content.find('\n',translationStart)
if translationEnd == -1:
translationEnd = len(content)
translation = content[translationStart+1:translationEnd].strip()
return content[start:end].strip(), translation
def formatFields(fields, markup): def formatFields(fields, markup):
@ -114,7 +108,6 @@ def markupVocabExp(definition):
'reading': definition['reading'] or unicode(), 'reading': definition['reading'] or unicode(),
'glossary': definition['glossary'], 'glossary': definition['glossary'],
'sentence': definition.get('sentence'), 'sentence': definition.get('sentence'),
'translation': definition.get('translation'),
'summary': summary 'summary': summary
} }
@ -126,7 +119,6 @@ def markupVocabReading(definition):
'reading': unicode(), 'reading': unicode(),
'glossary': definition['glossary'], 'glossary': definition['glossary'],
'sentence': definition.get('sentence'), 'sentence': definition.get('sentence'),
'translation': definition.get('translation'),
'summary': definition['reading'] 'summary': definition['reading']
} }