Skip to main content

prepare_runtime_paths_for

Function prepare_runtime_paths_for 

Source
pub fn prepare_runtime_paths_for(
    resources: &Path,
    user_data: &Path,
    cache: &Path,
    content_id: &str,
    schemes: SchemeSet,
) -> Result<RuntimePaths>
Expand description

按会话允许的方案准备代次,资源目录只要有这些方案读的词库。schemes 读 msime-pinyin.db(SchemeSet::reads_main_dictionary,即含全拼、双拼或五笔)时与 prepare_runtime_paths 完全相同:msime-pinyin.db 和 msime-english.db 都必须在资源目录里,都复制进代次。不读它时(只有日文、韩语、越南语、藏文、粤语、注音、笔画这类方案)资源目录不必有它,代次里也没有它;这样的集合也不要求 msime-english.db(SchemeSet::requires_english_dictionary),资源目录带了它就复制进代次、日志只回放英文行(replay_english),没带就连它也没有、日志一行也不回放(记录留在日志里,以后带英文库的代次照样回放)。粤语、注音、笔画的语言库和日文模型不经过代次,会话从 SessionOptions 给的路径或资源目录直接读。