-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathlivemining.html
90 lines (68 loc) · 5.82 KB
/
livemining.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nazeka: Configuration for Live Mining</title>
<script type="text/javascript" src="livemining.js"></script>
<style>
body { max-width: 800px; margin-left: auto; margin-right: auto; padding-left: 8px; padding-right: 8px; }
</style>
</head>
<body>
<h2>Configuration for Live Mining</h2>
<p>Live Mining must also be enabled on the options page, not just configured.</p>
<p>Live Mining requires <a href="https://apps.ankiweb.net/">Anki</a> and the <a href="https://ankiweb.net/shared/info/2055492159">Ankiconnect</a> plugin.</p>
<p>If Live Mining is enabled, then when you mine words to the mining storage (the list you see when you select "View Mined Cards"), Nazeka will also attempt to connect to Ankiconnect and tell it to insert a new note.</p>
<p>If this is your first time using live mining, please press the button below. This will make Ankiconnect ask you if it's okay to update to the latest version, then update if you say yes. Doing so fixes several bugs present in old versions of Ankiconnect, and this is important, because the version on Ankiweb sometimes falls behind the latest version. This requires Anki to be running with Ankiconnect already enabled.</p>
<input type="button" id="upgrade" value="Update Ankiconnect">
<h2>Deck and Model</h2>
<input type="text" value="Default" id="deckname"><br>
<label for="deckname">Deck name. Must be exact.</label><br>
<input type="text" value="Basic" id="modelname"><br>
<label for="modelname">Card model/template name. Must be exact.</label><br>
<h2>Fields</h2>
<input type="button" id="autofields" value="Populate"><br>
<label for="autofields">Populate button will connect to Ankiconnect and automatically populate a list of field inputs based on card model/template name, overwriting EVERYTHING that is currently here.</label><br>
<div id="containfields">
(Unpopulated)
</div>
<input type="button" id="applyfields" value="Apply">
<input type="button" id="loadfields" value="Reset">
<h2>Behavior notes</h2>
<ul>
<li>The "found spelling" is the spelling you clicked on to mine the word. You can only mine by clicking on the main highlighted spelling.</li>
<li>If you moused over non-kana, the "found spelling" is the matching non-kana spelling, and only the readings compatible with the "found spelling" are listed.</li>
<li>if you moused over kana, the "found spelling" is JMDict's favorite spelling, and all readings are listed (this part may change in the future).</li>
<li>If you moused over kana but there was no non-kana spelling, the reading from which the word was found is moved into the "found spelling" slot, <b>and removed from the base list of readings</b>.</li>
<li>The readings are filtered to be limited to the ones compatible with the "found spelling".</li>
<li>If you have a JSON dictionary imported, its definition will be appended to the JMDict definition.</li>
<li>Sentence detection is very lazy and will have weird cutoffs in certain situations.</li>
<li>Not all words have audio.</li>
</ul>
<h2>About formatters</h2>
<p style="white-space:pre-line;font-family: monospace"
>nothing - Nothing.
found_spelling - The spelling you clicked on to mine the word (e.g. "行く") (this is always the "found spelling" described above)
readings - Readings (this is the list of readings you see in the mining UI when mining the word)
definitions - Definition (HTML; has spans with class names, newlines are <br> tags)
definitions_raw - Definition (plaintext, linebreaks are LF characters; only for templates with special CSS or JS)
found_text - Text the word was found as (e.g. "行きます"). Also known as "found text".
context - The sentence you found the word in. Sentence boundaries are a guess, so it might be cut off funny and need manual editing inside of anki.
context_left - The left half of the sentence you found the word in, until the found text.
context_right - The right half of the sentence you found the word in, after the found text.
audio_anki - anki audio tag (e.g. "[sound:nazeka_audio_ねにもつ_根に持つ.mp3]"), downloaded by Nazeka, sent to anki with Ankiconnect's storeMediaFile command; added even if the storeMediaFile command fails; not all words have audio, may be blank
audio_kanji - spelling portion of audio file's name, does no downloading of files. if there are no spellings, it's identical to audio_reading. may be blank.
audio_reading - reading portion of audio file's name, does no downloading of files. may be blank.
If you use the "audio" field, then the audio file is downloaded from jpod101's servers when you mine the card, and sent to Anki's media folder with Ankiconnect's storeMediaFile action. This only works when you're connected to the internet.
The "audio_kanji" and "audio_reading" fields are for people with the JDIC audio pack, or recovering the audio manually if you mined while your internet was down, or for people who want to play the audio file from jpod101's servers directly so they don't need to store it as a media file. (Not sure whether Anki currently supports that, but it should be possible in the future.)
jmdict_id - JMDict numeric ID
url - URL of the page the card was mined from (if it was the reader page, it will look like jibberish)
page_title - Title of the page the card was mined from
time_unix - Time when card was mined (unix timestamp, milliseconds, can be converted to a localized date within Anki by using javascript in the card model/template)
time_local - Time when card was mined (localized date, depends on browser and OS)
readings_raw - The unfiltered list of readings associated with the given word. Tags and restriction information, like さくや not being a reading of 夕べ, are stripped.
spellings_raw - The unfiltered list of spellings associated with the given word. Tags and restriction information are stripped.
</p>
</body>
</html>