line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
our $VERSION = "0.05"; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use 5.014; |
5
|
1
|
|
|
1
|
|
882
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
7
|
1
|
|
|
1
|
|
579
|
|
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
4
|
|
8
|
|
|
|
|
|
|
use App::Greple::subst; |
9
|
1
|
|
|
1
|
|
499
|
|
|
1
|
|
|
|
|
164482
|
|
|
1
|
|
|
|
|
215
|
|
10
|
|
|
|
|
|
|
use File::Share qw(:all); |
11
|
1
|
|
|
1
|
|
14
|
$ENV{DESUMASU_DICT} = dist_dir __PACKAGE__ =~ s/::/-/gr; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
219
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
1; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=encoding utf-8 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
App::Greple::subst::desumasu - Japanese DESU/MASU dictionary for App::Greple::subst |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
greple -Msubst::desumasu --dearu --subst --all file |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
greple -Msubst::desumasu --dearu --diff file |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
greple -Msubst::desumasu --dearu --replace file |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 DESCRIPTION |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
greple -Msubst module based on |
32
|
|
|
|
|
|
|
L<desumasu-converter|https://github.com/kssfilo/desumasu-converter>. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This is a simple checker/converter module for Japanese writing style |
35
|
|
|
|
|
|
|
so called DUSU/MASU (ですます調: 敬体) and DEARU (である調: 常体). |
36
|
|
|
|
|
|
|
This is not my own idea and the dictionary is based on |
37
|
|
|
|
|
|
|
L<https://github.com/kssfilo/desumasu-converter>. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
See article L<https://kanasys.com/tech/722> for detail. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 OPTIONS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=over 7 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item B<--dearu> |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item B<--dearu-n> |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item B<--dearu-N> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Convert DESU/MASU to DEARU style. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
DESU (です) and MASU (ます) sometimes followed by NE (ね) in frank |
54
|
|
|
|
|
|
|
situation, and that NE (ね) is removed from converted result by |
55
|
|
|
|
|
|
|
default. Option with B<-n> keep that NE (ね), and option with B<-N> |
56
|
|
|
|
|
|
|
igonore them. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item B<--desumasu> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item B<--desumasu-n> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item B<--desumasu-N> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Convert DEARU to DESU/MASU style. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=back |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Use them with B<greple> B<-Msubst> options. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=over 7 |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item B<--subst --all --no-color> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Print converted text. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item B<--diff> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Produce diff output of original and converted text. Use B<cdif> |
79
|
|
|
|
|
|
|
command in L<App::sdif> to visualize the difference. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item B<--create> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item B<--replace> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item B<--overwrite> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
To update the file, use these options. Option B<--create> make new |
88
|
|
|
|
|
|
|
file with C<.new> suffix. Option B<--replace> update the target file |
89
|
|
|
|
|
|
|
with backup, while option B<--overwrite> does without backup. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
See L<App::Greple::subst> for other options. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 INSTALL |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 CPANMINUS |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
From CPAN: |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
cpanm App::Greple::subst::desumasu |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
From GIT repository: |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
cpanm https://github.com/kaz-utashiro/greple-subst-desumasu.git |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 SEE ALSO |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
L<App::Greple>, L<App::Greple::subst> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
L<App::sdif> |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
L<https://github.com/kssfilo/desumasu-converter>, |
114
|
|
|
|
|
|
|
L<https://kanasys.com/tech/722> |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
L<greple で「ですます調」を「である化」する|https://qiita.com/kaz-utashiro/items/8f4878300043ce7b73e7> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 AUTHOR |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Kazumasa Utashiro |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 LICENSE |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Copyright 2021-2022 Kazumasa Utashiro. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
127
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=cut |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
option default -Msubst |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
define DICTDIR $ENV{DESUMASU_DICT} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
option --desumasu --dict DICTDIR/desumasu.dict |
137
|
|
|
|
|
|
|
option --dearu --dict DICTDIR/dearu.dict |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
option --desumasu-n --dict DICTDIR/desumasu-keep-ne.dict |
140
|
|
|
|
|
|
|
option --dearu-n --dict DICTDIR/dearu-keep-ne.dict |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
option --desumasu-N --dict DICTDIR/desumasu-ignore-ne.dict |
143
|
|
|
|
|
|
|
option --dearu-N --dict DICTDIR/dearu-ignore-ne.dict |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# LocalWords: diff cdif |