[−][src]Function tokenizations::get_charmap
pub fn get_charmap(a: &str, b: &str) -> (CharMap, CharMap)
Returns character mappings c_a2b
(from a
to b
) and c_b2a
(from b
to a
) based on shortest edit script (SES).
Examples
Basic usage:
use tokenizations::get_charmap; let a = "foo"; let b = "f0oo"; let (c_a2b, c_b2a) = get_charmap(a, b); assert_eq!(c_a2b, vec![Some(0), Some(2), Some(3)]); assert_eq!(c_b2a, vec![Some(0), None, Some(1), Some(2)]);