MCPcopy Create free account
hub / github.com/daisy/MathCAT / shift_text

Method shift_text

src/canonicalize.rs:2574–2764  ·  view source on GitHub ↗
(old_text: &str, char_mapping: &[u32; 3])

Source from the content-addressed store, hash-verified

2572 return mi;
2573
2574 fn shift_text(old_text: &str, char_mapping: &[u32; 3]) -> String {
2575 // if there is no block for something, use 'a', 'A', 0 as that will be a no-op
2576 struct Offsets {
2577 ch: u32,
2578 table: usize,
2579 }
2580 static SHIFT_AMOUNTS: phf::Map<char, Offsets> = phf_map! {
2581 'A' => Offsets{ ch: 0, table: 0},
2582 'B' => Offsets{ ch: 1, table: 0},
2583 'C' => Offsets{ ch: 2, table: 0},
2584 'D' => Offsets{ ch: 3, table: 0},
2585 'E' => Offsets{ ch: 4, table: 0},
2586 'F' => Offsets{ ch: 5, table: 0},
2587 'G' => Offsets{ ch: 6, table: 0},
2588 'H' => Offsets{ ch: 7, table: 0},
2589 'I' => Offsets{ ch: 8, table: 0},
2590 'J' => Offsets{ ch: 9, table: 0},
2591 'K' => Offsets{ ch: 10, table: 0},
2592 'L' => Offsets{ ch: 11, table: 0},
2593 'M' => Offsets{ ch: 12, table: 0},
2594 'N' => Offsets{ ch: 13, table: 0},
2595 'O' => Offsets{ ch: 14, table: 0},
2596 'P' => Offsets{ ch: 15, table: 0},
2597 'Q' => Offsets{ ch: 16, table: 0},
2598 'R' => Offsets{ ch: 17, table: 0},
2599 'S' => Offsets{ ch: 18, table: 0},
2600 'T' => Offsets{ ch: 19, table: 0},
2601 'U' => Offsets{ ch: 20, table: 0},
2602 'V' => Offsets{ ch: 21, table: 0},
2603 'W' => Offsets{ ch: 22, table: 0},
2604 'X' => Offsets{ ch: 23, table: 0},
2605 'Y' => Offsets{ ch: 24, table: 0},
2606 'Z' => Offsets{ ch: 25, table: 0},
2607 'a' => Offsets{ ch: 26, table: 0},
2608 'b' => Offsets{ ch: 27, table: 0},
2609 'c' => Offsets{ ch: 28, table: 0},
2610 'd' => Offsets{ ch: 29, table: 0},
2611 'e' => Offsets{ ch: 30, table: 0},
2612 'f' => Offsets{ ch: 31, table: 0},
2613 'g' => Offsets{ ch: 32, table: 0},
2614 'h' => Offsets{ ch: 33, table: 0},
2615 'i' => Offsets{ ch: 34, table: 0},
2616 'j' => Offsets{ ch: 35, table: 0},
2617 'k' => Offsets{ ch: 36, table: 0},
2618 'l' => Offsets{ ch: 37, table: 0},
2619 'm' => Offsets{ ch: 38, table: 0},
2620 'n' => Offsets{ ch: 39, table: 0},
2621 'o' => Offsets{ ch: 40, table: 0},
2622 'p' => Offsets{ ch: 41, table: 0},
2623 'q' => Offsets{ ch: 42, table: 0},
2624 'r' => Offsets{ ch: 43, table: 0},
2625 's' => Offsets{ ch: 44, table: 0},
2626 't' => Offsets{ ch: 45, table: 0},
2627 'u' => Offsets{ ch: 46, table: 0},
2628 'v' => Offsets{ ch: 47, table: 0},
2629 'w' => Offsets{ ch: 48, table: 0},
2630 'x' => Offsets{ ch: 49, table: 0},
2631 'y' => Offsets{ ch: 50, table: 0},

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected