View source code
Display the source code in std/uni.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
std.uni.CodepointSetTrie/codepointSetTrie
- multiple declarations
Template codepointSetTrie
A shorthand for creating a custom multi-level fixed Trie
from a CodepointSet
. sizes
are numbers of bits per level,
with the most significant bits used first.
template codepointSetTrie(sizes...)
;
Contained Functions
Name | Description |
---|---|
codepointSetTrie |
Note
The sum of sizes
must be equal 21.
See Also
toTrie
, which is even simpler.
Example
{
import std .stdio;
auto set = unicode("Number");
auto trie = codepointSetTrie!(8, 5, 8)(set);
writeln("Input code points to test:");
foreach (line; stdin .byLine)
{
int count=0;
foreach (dchar ch; line)
if (trie[ch])// is number
count++;
writefln("Contains %d number code points.", count);
}
}
Alias CodepointSetTrie
Type of Trie generated by codepointSetTrie function.
alias CodepointSetTrie(sizes...)
= typeof(TrieBuilder!(bool,dchar,lastDchar+1,Prefix)(false) .build());
Authors
Dmitry Olshansky
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.