mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 08:57:54 +00:00
plus symbol
This commit is contained in:
1 parent
dbc776292a
commit
fd45d9416a
5 files changed
+32
-1
No files matched your search
@@ -21,6 +21,9 @@ Audio
|
||||
- No more missing phonemes
|
||||
|
||||
Cleanup
|
||||
- Refactor into a very well-defined "SpeakRequest" with all
|
||||
parameters, including new ones like "is_twitter",
|
||||
"missing_word_mode = slience, record_pop, umm", etc.
|
||||
- Remove old query parameters
|
||||
- Set default volume
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
These words aren't in the dictionary
|
||||
------------------------------------
|
||||
+ (plus symbol)
|
||||
banjo-tooie
|
||||
charizard
|
||||
crafted
|
||||
fearmongers
|
||||
ganon
|
||||
ganondorf
|
||||
gorp
|
||||
|
||||
+2
-1
@@ -85,7 +85,8 @@ impl Parser {
|
||||
match *v {
|
||||
Symbol::Ampersand => sentence.push("and".to_string()),
|
||||
Symbol::AtSign => sentence.push("at".to_string()),
|
||||
Symbol::Percent => sentence.push("percent".to_string()),
|
||||
Symbol::Percent => sentence.push("percent".to_string()),
|
||||
Symbol::Plus => sentence.push("plus".to_string()),
|
||||
Symbol::GreaterThan => {
|
||||
sentence.push("greater".to_string());
|
||||
sentence.push("than".to_string());
|
||||
|
||||
@@ -78,6 +78,7 @@ pub enum Symbol {
|
||||
GreaterThan,
|
||||
LessThan,
|
||||
Percent,
|
||||
Plus,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq)]
|
||||
@@ -212,6 +213,10 @@ impl Token {
|
||||
Token::Punctuation { value: Punctuation::Period }
|
||||
}
|
||||
|
||||
pub fn plus() -> Token {
|
||||
Token::Symbol { value: Symbol::Plus }
|
||||
}
|
||||
|
||||
pub fn question() -> Token {
|
||||
Token::Punctuation { value: Punctuation::Question }
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ impl Tokenizer {
|
||||
}
|
||||
|
||||
// Symbols
|
||||
// FIXME: Map lookup for speedup.
|
||||
if unknown == "@" {
|
||||
output.push_back(Token::at_sign());
|
||||
continue;
|
||||
@@ -162,6 +163,9 @@ impl Tokenizer {
|
||||
} else if unknown == ">" {
|
||||
output.push_back(Token::greater_than());
|
||||
continue;
|
||||
} else if unknown == "+" {
|
||||
output.push_back(Token::plus());
|
||||
continue;
|
||||
}
|
||||
|
||||
// Match hashtags.
|
||||
@@ -707,6 +711,22 @@ mod tests {
|
||||
assert_eq!(expected, result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_symbols() {
|
||||
let t = make_tokenizer();
|
||||
|
||||
let result = t.tokenize("& < > + % @");
|
||||
let expected = vec![
|
||||
Token::ampersand(),
|
||||
Token::less_than(),
|
||||
Token::greater_than(),
|
||||
Token::plus(),
|
||||
Token::percent(),
|
||||
Token::at_sign(),
|
||||
];
|
||||
assert_eq!(expected, result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_percent_symbol() {
|
||||
let t = make_tokenizer();
|
||||
|
||||
Reference in new issue
Block a user