Packages

Compile-time generated set of modules to ease an access to a predefined subset of UTF8 symbols.

Current section

Files

Jump to
string_naming README.md
Raw

README.md

# String.Naming
**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.1"}]
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 `String.Naming`.
Each nested module is granted with `__all__/0` function that returns all the
available symbols in that particular namespace.
```elixir
iex|1 β–Ά String.Naming.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 β–Ά String.Naming.AnimalSymbols.monkey
"πŸ’"
```
## 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).