2023-08-17 18:03:46 +00:00
|
|
|
use revision::revisioned;
|
2023-05-10 02:08:09 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use std::fmt;
|
|
|
|
use std::fmt::Display;
|
|
|
|
|
2023-08-18 22:51:56 +00:00
|
|
|
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
|
2024-01-09 15:34:52 +00:00
|
|
|
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
2023-08-17 18:03:46 +00:00
|
|
|
#[revisioned(revision = 1)]
|
2023-05-10 02:08:09 +00:00
|
|
|
pub enum Tokenizer {
|
2023-06-19 18:41:13 +00:00
|
|
|
Blank,
|
|
|
|
Camel,
|
|
|
|
Class,
|
|
|
|
Punct,
|
2023-05-10 02:08:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Display for Tokenizer {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
f.write_str(match self {
|
2023-06-19 18:41:13 +00:00
|
|
|
Self::Blank => "BLANK",
|
|
|
|
Self::Camel => "CAMEL",
|
|
|
|
Self::Class => "CLASS",
|
|
|
|
Self::Punct => "PUNCT",
|
2023-05-10 02:08:09 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|