novel-cli 0.17.0

A set of tools for downloading novels from the web, manipulating text, and generating EPUB
Documentation
pub static CONVERT_MAP: phf::Map<char, char> = phf::phf_map! {
    '' => '"',
    '' => '#',
    '' => '$',
    '' => '%',
    '' => '&',
    '' => '\'',
    '' => '*',
    '' => '+',
    '' => '.',
    '' => '/',
    '' => '0',
    '' => '1',
    '' => '2',
    '' => '3',
    '' => '4',
    '' => '5',
    '' => '6',
    '' => '7',
    '' => '8',
    '' => '9',
    '' => '<',
    '' => '=',
    '' => '>',
    '' => '@',
    '' => 'A',
    '' => 'B',
    '' => 'C',
    '' => 'D',
    '' => 'E',
    '' => 'F',
    '' => 'G',
    '' => 'H',
    '' => 'I',
    '' => 'J',
    '' => 'K',
    '' => 'L',
    '' => 'M',
    '' => 'N',
    '' => 'O',
    '' => 'P',
    '' => 'Q',
    '' => 'R',
    '' => 'S',
    '' => 'T',
    '' => 'U',
    '' => 'V',
    '' => 'W',
    '' => 'X',
    '' => 'Y',
    '' => 'Z',
    '' => '\\',
    '' => '^',
    '' => '`',
    '' => 'a',
    '' => 'b',
    '' => 'c',
    '' => 'd',
    '' => 'e',
    '' => 'f',
    '' => 'g',
    '' => 'h',
    '' => 'i',
    '' => 'j',
    '' => 'k',
    '' => 'l',
    '' => 'm',
    '' => 'n',
    '' => 'o',
    '' => 'p',
    '' => 'q',
    '' => 'r',
    '' => 's',
    '' => 't',
    '' => 'u',
    '' => 'v',
    '' => 'w',
    '' => 'x',
    '' => 'y',
    '' => 'z',
    '' => '{',
    '' => '|',
    '' => '}',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '·',
    '' => '·',
    '' => '',
    '' => '',
    '' => '',
    '' => '·',
    '' => '·',
    '' => '',
    '' => '',
    '' => '',
    '?' => '',
    '!' => '',
    ',' => '',
    ';' => '',
    '(' => '',
    ')' => '',
};

// https://zh.wiktionary.org/wiki/
pub static CONVERT_T2S_MAP: phf::Map<char, char> = phf::phf_map! {
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
    '' => '',
};

// https://zh.wikipedia.org/wiki/%E6%A0%87%E7%82%B9%E7%AC%A6%E5%8F%B7
static CHINESE_PUNCTUATION: phf::Set<char> = phf::phf_set! {
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    '',
    // ——
    '',
    // ……
    '',
    '',
    '-',
    '',
    '·',
    '',
    '',
    '',
    '',
    // ﹏﹏
    '',
    // __
    '_',
    '.'
};

#[must_use]
#[inline]
pub fn is_chinese_punctuation(c: char) -> bool {
    CHINESE_PUNCTUATION.contains(&c)
}

// https://zh.wikipedia.org/wiki/%E6%A0%87%E7%82%B9%E7%AC%A6%E5%8F%B7
static ENGLISH_PUNCTUATION: phf::Set<char> = phf::phf_set! {
    '.',
    '?',
    '!',
    ',',
    ':',
    '',
    ';',
    '-',
    '',
    '',
    '(',
    ')',
    '[',
    ']',
    '{',
    '}',
    '"',
    '\'',
    '/',
};

#[must_use]
#[inline]
pub fn is_english_punctuation(c: char) -> bool {
    ENGLISH_PUNCTUATION.contains(&c)
}

#[must_use]
#[inline]
pub fn is_punctuation(c: char) -> bool {
    is_chinese_punctuation(c) || is_english_punctuation(c)
}