https://github.com/tomill/lingua-ja-gal
https://github.com/tomill/lingua-ja-gal
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tomill/lingua-ja-gal
- Owner: tomill
- License: other
- Created: 2016-09-07T13:36:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-09T11:22:18.000Z (almost 10 years ago)
- Last Synced: 2025-10-22T07:03:34.098Z (9 months ago)
- Language: Prolog
- Homepage: https://metacpan.org/pod/Lingua::JA::Gal
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Lingua::JA::Gal - "ギャル文字" converter
# SYNOPSIS
use utf8;
use Lingua::JA::Gal;
$text = Lingua::JA::Gal->gal("こんにちは"); # => "⊇w丨ニちレ£"
# DESCRIPTION
"ギャル文字" (gal's alphabet) is a Japanese writing style
that was popular with Japanese teenage girls in the early 2000s.
[https://ja.wikipedia.org/wiki/%E3%82%AE%E3%83%A3%E3%83%AB%E6%96%87%E5%AD%97](https://ja.wikipedia.org/wiki/%E3%82%AE%E3%83%A3%E3%83%AB%E6%96%87%E5%AD%97)
# METHOD
## gal( $text, \[ \\%options \] )
Lingua::JA::Gal->gal("ギャルもじ"); # => "(キ〃ャlレ€U〃"
### OPTIONS
- `rate`
for converting rate. default is 100 (full).
Lingua::JA::Gal->gal($text, { rate => 100 }); # full(default)
Lingua::JA::Gal->gal($text, { rate => 50 }); # half
Lingua::JA::Gal->gal($text, { rate => 0 }); # nothing
- `callback`
if you want to do your own gal way.
Lingua::JA::Gal->gal($text, { callback => sub {
my ($char, $suggestions, $options) = @_;
# 漢字のみ変換する
if ($char =~ /p{Han}/) {
return $suggestions->[ int(rand @$suggestions) ];
} else {
return $char;
}
});
# EXPORT
no exports by default.
## gal
use Lingua::JA::Gal qw/gal/;
print gal("...");
# AUTHOR
Naoki Tomita
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.