pub fn ranges(
        &mut self,
        name: &str,
        codepoints: &BTreeSet<u32>,
    ) -> Result<()> {
        self.header()?;
        self.separator()?;

        let name = rust_const_name(name);
        if self.opts.fst_dir.is_some() {
            let mut builder = SetBuilder::memory();
            builder.extend_iter(codepoints.iter().cloned().map(u32_key))?;
            let set = builder.into_set();
            self.fst(&name, set.as_fst(), false)?;
        } else if self.opts.trie_set {
            let set: Vec<u32> = codepoints.iter().cloned().collect();
            let trie = TrieSetOwned::from_codepoints(&set)?;
            self.trie_set(&name, &trie)?;
        } else {
            let ranges = util::to_ranges(codepoints.iter().cloned());
            self.ranges_slice(&name, &ranges)?;
        }
        self.wtr.flush()?;
        Ok(())
    }
/// Write a sorted sequence of codepoints.
///
/// Note that the specific representation of ranges may differ with the
/// output format. For example, if the output format is a slice, then a
/// straight-forward slice of sorted codepoint ranges is emitted. But if
/// the output format is an FST or similar, then all codepoints are
/// explicitly represented.
Write a sorted sequence of codepoints.
Note that the specific representation of ranges may differ with the
output format. For example, if the output format is a slice, then a
straight-forward slice of sorted codepoint ranges is emitted. But if
the output format is an FST or similar, then all codepoints are
explicitly represented.
Write a sorted sequence of codepoints . Note that the specific representation of ranges may differ with the output format . For example if the output format is a slice then a straight - forward slice of sorted codepoint ranges is emitted . But if the output format is an FST or similar then all codepoints are explicitly represented .
pub fn ranges(
        &mut self,
        name: &str,
        codepoints: &BTreeSet<u32>,
    ) -> Result<()> {
        self.header()?;
        self.separator()?;
        let name = rust_const_name(name);
        if self.opts.fst_dir.is_some() {
            let mut builder = SetBuilder::memory();
            builder.extend_iter(codepoints.iter().cloned().map(u32_key))?;
            let set = builder.into_set();
            self.fst(&name, set.as_fst(), false)?;
        } else if self.opts.trie_set {
            let set: Vec<u32> = codepoints.iter().cloned().collect();
            let trie = TrieSetOwned::from_codepoints(&set)?;
            self.trie_set(&name, &trie)?;
        } else {
            let ranges = util::to_ranges(codepoints.iter().cloned());
            self.ranges_slice(&name, &ranges)?;
        }
        self.wtr.flush()?;
        Ok(())
    }
pub fn ranges ( & mut self , name : & str , codepoints : & BTreeSet < u32 > , ) -> Result < ( ) > { self . header ( ) ? ; self . separator ( ) ? ; let name = rust_const_name ( name ) ; if self . opts . fst_dir . is_some ( ) { let mut builder = SetBuilder :: memory ( ) ; builder . extend_iter ( codepoints . iter ( ) . cloned ( ) . map ( u32_key ) ) ? ; let set = builder . into_set ( ) ; self . fst ( & name , set . as_fst ( ) , false ) ? ; } else if self . opts . trie_set { let set : Vec < u32 > = codepoints . iter ( ) . cloned ( ) . collect ( ) ; let trie = TrieSetOwned :: from_codepoints ( & set ) ? ; self . trie_set ( & name , & trie ) ? ; } else { let ranges = util :: to_ranges ( codepoints . iter ( ) . cloned ( ) ) ; self . ranges_slice ( & name , & ranges ) ? ; } self . wtr . flush ( ) ? ; Ok ( ( ) ) }
Write a sorted sequence of codepoints.
Write a sorted sequence of codepoints .
&mut self
name
&str
codepoints
&BTreeSet<u32>
&mut self
name
&str
codepoints
&BTreeSet<u32>