quininer / epub2txt Goto Github PK
View Code? Open in Web Editor NEWsimple EPUB to TXT converter.
simple EPUB to TXT converter.
use std::fs;
fn main() {
// 创建vb文件夹
if let Err(e) = fs::create_dir("vb") {
if e.kind() != std::io::ErrorKind::AlreadyExists {
panic!("Failed to create directory: {:?}", e);
}
}
// 读取vb.txt文件
let content = match fs::read_to_string("vb.txt") {
Ok(s) => s,
Err(e) => panic!("Failed to read file: {:?}", e),
};
// 以四个中横杠隔开文本
let parts: Vec<&str> = content.split("-----").collect();
// 保存每个部分文本到文件
for (i, part) in parts.iter().enumerate() {
// 生成文件名
let filename = format!("vb/vb_part{}.txt", i+1);
// 写入文件
match fs::write(filename, part) {
Ok(_) => {},
Err(e) => panic!("Failed to write file: {:?}", e),
};
}
}
Compiling sanngaa v0.1.0 (https://github.com/quininer/sanngaa.git?rev=644c785cfd10bf2ff9968f38007f1365f563c1e0#644c785c)
error[E0308]: mismatched types
--> .cargo/git/checkouts/sanngaa-2d86df33939e943a/644c785/src/parser.rs:67:27
|
67 | qualname_to_qname(target.as_element().unwrap().name.clone())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct html5ever_atoms::QualName
, found struct markup5ever::interface::QualName
|
= note: expected type html5ever_atoms::QualName
found type markup5ever::interface::QualName
Running on MacOSX 10.10.5 with Python 2.7 (also tried with Anaconda 3.5.3)
I will run my own tests soon but I was wondering if you have already run any tests comparing your tool to the existing KevinBoone tool and what are the differences in output and speed and whatever between the two?
Thanks :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.