AnkiDeckImportService
in package
FinalYes
Creates LWT terms from a deck the user built in Anki (issue #228).
This is the "seed my known words" path: rather than reclassifying thousands of words by hand while reading, the user points LWT at a deck they already study and LWT infers each word's status from Anki's own scheduling data.
Distinct from ApkgImportService, which merges an LWT-exported file
back into the terms it came from. That one matches on lwt- guids and
updates; this one has no guids to match and only ever creates.
Table of Contents
Constants
- MAX_TERM_LENGTH : mixed = 250
- `words.WoText` is varchar(250).
- SAMPLE_SIZE : mixed = 8
- How many created terms to show back in the summary.
Properties
Methods
- __construct() : mixed
- default() : self
- import() : DeckImportResult
- cleanFieldValue() : string
- translationFor() : string
Constants
MAX_TERM_LENGTH
`words.WoText` is varchar(250).
private
mixed
MAX_TERM_LENGTH
= 250
SAMPLE_SIZE
How many created terms to show back in the summary.
private
mixed
SAMPLE_SIZE
= 8
Properties
$reader read-only
private
ForeignApkgReader
$reader
$words read-only
private
WordCrudService
$words
Methods
__construct()
public
__construct(ForeignApkgReader $reader, WordCrudService $words) : mixed
Parameters
- $reader : ForeignApkgReader
- $words : WordCrudService
default()
public
static default() : self
Return values
selfimport()
public
import(string $apkgPath, DeckImportSettings $settings) : DeckImportResult
Parameters
- $apkgPath : string
- $settings : DeckImportSettings
Return values
DeckImportResultcleanFieldValue()
private
cleanFieldValue(string $value) : string
Parameters
- $value : string
Return values
stringtranslationFor()
private
translationFor(ForeignNote $note, DeckImportSettings $settings) : string
Parameters
- $note : ForeignNote
- $settings : DeckImportSettings