pub fn parse_many_by_codepoint<P, D>(
    ucd_dir: P,
) -> Result<BTreeMap<Codepoint, Vec<D>>, Error>
where
    P: AsRef<Path>,
    D: UcdFileByCodepoint,
{
    let mut map = BTreeMap::new();
    for result in D::from_dir(ucd_dir)? {
        let x = result?;
        for cp in x.codepoints() {
            map.entry(cp).or_insert(vec![]).push(x.clone());
        }
    }
    Ok(map)
}
/// Parse a particular file in the UCD into a map from codepoint to all
/// records associated with that codepoint.
///
/// This is useful for files that have multiple records for each codepoint.
/// For example, the `NameAliases.txt` file lists multiple aliases for some
/// codepoints.
///
/// The given directory should be the directory to the UCD.
Parse a particular file in the UCD into a map from codepoint to all
records associated with that codepoint.

This is useful for files that have multiple records for each codepoint.
For example, the `NameAliases.txt` file lists multiple aliases for some
codepoints.

The given directory should be the directory to the UCD.
Parse a particular file in the UCD into a map from codepoint to all records associated with that codepoint . This is useful for files that have multiple records for each codepoint . For example the ` NameAliases . txt ` file lists multiple aliases for some codepoints . The given directory should be the directory to the UCD .
pub fn parse_many_by_codepoint<P, D>(
    ucd_dir: P,
) -> Result<BTreeMap<Codepoint, Vec<D>>, Error>
where
    P: AsRef<Path>,
    D: UcdFileByCodepoint,
{
    let mut map = BTreeMap::new();
    for result in D::from_dir(ucd_dir)? {
        let x = result?;
        for cp in x.codepoints() {
            map.entry(cp).or_insert(vec![]).push(x.clone());
        }
    }
    Ok(map)
}
pub fn parse_many_by_codepoint < P , D > ( ucd_dir : P , ) -> Result < BTreeMap < Codepoint , Vec < D > > , Error > where P : AsRef < Path > , D : UcdFileByCodepoint , { let mut map = BTreeMap :: new ( ) ; for result in D :: from_dir ( ucd_dir ) ? { let x = result ? ; for cp in x . codepoints ( ) { map . entry ( cp ) . or_insert ( vec ! [ ] ) . push ( x . clone ( ) ) ; } } Ok ( map ) }
Parse a particular file in the UCD into a map from codepoint to all
records associated with that codepoint.
Parse a particular file in the UCD into a map from codepoint to all records associated with that codepoint .
ucd_dir
P
ucd_dir
P