pub enum Adapter {
Liteparse,
}Expand description
A JSON format the writer can read OCR boxes from.
Variants§
Liteparse
LiteParse lit parse --format json.
Reads pages[].text_items[] whose font_name is "OCR"; native-text
items keep their real font name and are skipped. rotation is read when
present (--extract-text-metadata). The 0.1 field names textItems and
fontName are still accepted.
Implementations§
Source§impl Adapter
impl Adapter
Sourcepub fn parse(self, document: &Value) -> Vec<ParsedPage>
pub fn parse(self, document: &Value) -> Vec<ParsedPage>
The pages of document that carry OCR boxes, in document order.
Pages without OCR boxes are omitted. Malformed pages and items are skipped rather than rejected, so one bad entry does not cost the rest.
Sourcepub fn parse_str(self, json: &str) -> Result<Vec<ParsedPage>, Error>
pub fn parse_str(self, json: &str) -> Result<Vec<ParsedPage>, Error>
Parse a JSON document held in memory.
Sourcepub fn parse_file(
self,
path: impl AsRef<Path>,
) -> Result<Vec<ParsedPage>, Error>
pub fn parse_file( self, path: impl AsRef<Path>, ) -> Result<Vec<ParsedPage>, Error>
Parse the JSON file at path.
Trait Implementations§
impl Copy for Adapter
impl Eq for Adapter
impl StructuralPartialEq for Adapter
Auto Trait Implementations§
impl Forget for Adapter
impl Freeze for Adapter
impl Move for Adapter
impl RefUnwindSafe for Adapter
impl Send for Adapter
impl Sync for Adapter
impl Unpin for Adapter
impl UnsafeUnpin for Adapter
impl UnwindSafe for Adapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more