Current section
Files
Jump to
Current section
Files
string_naming
README.md
README.md
# StringNaming
**Compile-time generated set of modules to ease an access to a predefined subset of UTF8 symbols.**
## Installation
```elixir
def deps do
[{:string_naming, "~> 0.3"}]
end
```
## Warning
**The initial compilation of the module in the default configuration takes β 10 sec.**
The compilation of the whole UTF8 symbol set requires β 10 min.
## `config/confix.exs`
The configuration of what is to be compiled could be changed accordingly to
what might be found in [default config](https://github.com/am-kantox/string_naming/blob/master/config/config.exs).
Basically, leading `'#'` and `'='` in front of group names are treated as comments.
## How it works
The code parses the [`NamesList.txt`](http://www.unicode.org/Public/UCD/latest/ucd/NamesList.txt)
file provided by Consortium. It builds the set of nested modules under `StringNaming`.
Each nested module is granted with `__all__/0` function that returns all the
available symbols in that particular namespace.
```elixir
iex|1 βΆ StringNaming.AnimalSymbols.__all__
[ant: "π", bat: "π¦", bird: "π¦", blowfish: "π‘", boar: "π",
bug: "π", butterfly: "π¦", cat: "π", chicken: "π", chipmunk: "πΏ",
cow: "π", crab: "π¦", crocodile: "π", deer: "π¦", dog: "π",
dolphin: "π¬", dragon: "π", duck: "π¦", eagle: "π¦
", elephant: "π",
fish: "π", goat: "π", gorilla: "π¦", honeybee: "π", horse: "π",
koala: "π¨", leopard: "π", lizard: "π¦", monkey: "π", mouse: "π",
octopus: "π", owl: "π¦", ox: "π", penguin: "π§", pig: "π",
poodle: "π©", rabbit: "π", ram: "π", rat: "π", rhinoceros: "π¦",
rooster: "π", scorpion: "π¦", shark: "π¦", sheep: "π",
shrimp: "π¦", snail: "π", snake: "π", spider: "π·", squid: "π¦",
tiger: "π
", ...]
iex|2 βΆ StringNaming.AnimalSymbols.monkey
"π"
```
## Changelog
#### `0.4.0`
Added `StringNaming.graphemes/1` function that receives a regular expression and
returns the list of matched characters:
```elixir
iex> StringNaming.graphemes ~r/\Aspace/i
[
space_medium_mathematical_space: "β",
spaces_em_quad: "β",
spaces_em_space: "β",
spaces_en_quad: "β",
spaces_en_space: "β",
spaces_figure_space: "β",
spaces_four_per_em_space: "β
",
spaces_hair_space: "β",
spaces_punctuation_space: "β",
spaces_six_per_em_space: "β",
spaces_thin_space: "β",
spaces_three_per_em_space: "β"
]
```
## Is it of any good?
Sure it is.
---
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/string_naming](https://hexdocs.pm/string_naming).