pub enum Language {
Spanish,
English,
German,
Italian,
}Expand description
Supported languages for invoice extraction
Each language has specific patterns for:
- Invoice number formats (e.g., “Factura Nº” vs “Invoice Number”)
- Date formats (DD/MM/YYYY vs MM/DD/YYYY vs DD.MM.YYYY)
- Number formats (1.234,56 vs 1,234.56)
- Field labels and terminology
§Language-Specific Behaviors
- Spanish: Uses European number format (1.234,56), DD/MM/YYYY dates
- English: Uses US/UK number format (1,234.56), DD/MM/YYYY dates
- German: Uses European number format (1.234,56), DD.MM.YYYY dates
- Italian: Uses European number format (1.234,56), DD/MM/YYYY dates
Variants§
Spanish
Spanish (Spain, Latin America)
Patterns include: “Factura”, “CIF”, “Base Imponible”, “IVA”
English
English (UK, US, International)
Patterns include: “Invoice”, “VAT Number”, “Subtotal”, “Total”
German
German (Germany, Austria, Switzerland)
Patterns include: “Rechnung”, “USt-IdNr.”, “Nettobetrag”, “MwSt.”
Italian
Italian (Italy)
Patterns include: “Fattura”, “Partita IVA”, “Imponibile”, “IVA”
Implementations§
Source§impl Language
impl Language
Sourcepub fn from_code(code: &str) -> Option<Self>
pub fn from_code(code: &str) -> Option<Self>
Convert language code to Language enum
§Examples
use oxidize_pdf::text::invoice::Language;
assert_eq!(Language::from_code("es"), Some(Language::Spanish));
assert_eq!(Language::from_code("en"), Some(Language::English));
assert_eq!(Language::from_code("invalid"), None);Trait Implementations§
impl Copy for Language
impl Eq for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnwindSafe for Language
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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