菊池寛と直木三十五の比較

菊池寛と直木三十五について

●菊池寛(きくち かん、1888‐1948)  香川県高松市生まれ。  小説家、劇作家、ジャーナリスト。文藝春秋社の設立者。  代表作「父帰る」(1917年)「恩讐の彼方に」(1919年)等。

●直木三十五(なおき さんじゅうご、1891‐1934)  大阪府大阪市生まれ。  小説家、脚本家、映画監督。  代表作「南国太平記」(1931年)等。 両者とも日本の近代の作家である。

*現在の「直木賞」は菊池寛によって作られたものである。

菊池寛の場合

まずファイルダウンロードして、解凍、ルビ取りをします

青空文庫から菊池寛を選んだとして、 新字新仮名でほぼ同じサイズのファイルを、適当選び、そのURLを調べます。

ある恋の話(1970年、サイズ15311) http://www.aozora.gr.jp/cards/000083/files/47856_ruby_32271.zip

恩讐の彼方に(1988年、サイズ23418)  http://www.aozora.gr.jp/cards/000083/files/496_ruby_19865.zip

藤十郎の恋(1970年、サイズ16074)  http://www.aozora.gr.jp/cards/000083/files/47857_ruby_31986.zip

無名作家の日記(1988年、サイズ19975)  http://www.aozora.gr.jp/cards/000083/files/492_ruby_19842.zip

蘭学事始(1988年、サイズ15885) http://www.aozora.gr.jp/cards/000083/files/497_ruby_3051.zip



source("/var/data/AozoraURL.R")


Aozora("http://www.aozora.gr.jp/cards/000083/files/47856_ruby_32271.zip", "K_1970arukoi")
## [1] "./NORUBY/K_1970arukoi2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/496_ruby_19865.zip", "K_1988onsyu")
## [1] "./NORUBY/K_1988onsyu2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/47857_ruby_31986.zip", "K_1970tojuro")
## [1] "./NORUBY/K_1970tojuro2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/492_ruby_19842.zip", "K_1988mumei")
## [1] "./NORUBY/K_1988mumei2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/497_ruby_3051.zip", "K_1988rangaku")
## [1] "./NORUBY/K_1988rangaku2.txt"
(folder <- getwd())
## [1] "/home/c101003043/c101003043-1"

まとめて解析を行う

library(RMeCab)
tmp <- paste(folder, "NORUBY", sep = "/")
setwd(tmp)
txts <- dir()
kikuchi <- data.frame()

for (i in txts) {
    x <- sum(nchar(readLines(i)))
    y <- RMeCabFreq(i)
    kuten <- y[y$Info2 == "句点", ]
    toten <- y[y$Info2 == "読点", ]
    z <- sum(y$Freq)  # / kuten$Freq
    kikuchi <- rbind(kikuchi, data.frame(text = i, chars = x, words = z, kuten = sum(kuten$Freq), 
        toten = sum(toten$Freq)))
}
## file = K_1970arukoi2.txt 
## length = 1530 
## file = K_1970tojuro2.txt 
## length = 1757 
## file = K_1988mumei2.txt 
## length = 1827 
## file = K_1988onsyu2.txt 
## length = 2451 
## file = K_1988rangaku2.txt 
## length = 1814


head(kikuchi)
##                 text chars words kuten toten
## 1  K_1970arukoi2.txt 14412  9916   245   768
## 2  K_1970tojuro2.txt 13308  9293   270   815
## 3   K_1988mumei2.txt 21452 14118   590  1012
## 4   K_1988onsyu2.txt 22805 15866   557  1356
## 5 K_1988rangaku2.txt 15563 10241   407   887

文の長さの中央値を求めてみます。

median(kikuchi$words/(kikuchi$kuten + kikuchi$toten))
## [1] 8.565
median(kikuchi$chars/(kikuchi$kuten + kikuchi$toten))
## [1] 12.27

一文あたりの単語数8.565 は、また文字数は 12.2654 とわかります。

結果をプロットしてみます。

plot(kikuchi$words/(kikuchi$kuten + kikuchi$toten), main = "一文の単語数", 
    xlab = "作品", type = "l")

plot of chunk unnamed-chunk-4

plot(kikuchi$chars/(kikuchi$kuten + kikuchi$toten), main = "一文の文字数", 
    xlab = "作品", type = "l")

plot of chunk unnamed-chunk-4

unlink(tmp, recursive = T)

直木三十五の場合

まずファイルの選定、ダウンロードと処理

鍵屋の辻(1995年、サイズ13505)  http://www.aozora.gr.jp/cards/000216/files/1069_ruby.zip

三人の相馬大作(1989年、サイズ32429)  http://www.aozora.gr.jp/cards/000216/files/1721_ruby_24963.zip

寺坂吉右衛門の逃亡(1989年、サイズ10001) http://www.aozora.gr.jp/cards/000216/files/1722_ruby_24431.zip

巌流島(1995年、サイズ10025)  http://www.aozora.gr.jp/cards/000216/files/1715_ruby_2640.zip

寛永武道鑑(1989年、サイズ12863)  http://www.aozora.gr.jp/cards/000216/files/1723_ruby_24430.zip

source("/var/data/AozoraURL.R")

Aozora("http://www.aozora.gr.jp/cards/000216/files/1069_ruby.zip", "N_1995kagiya")
## [1] "./NORUBY/N_1995kagiya2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1721_ruby_24963.zip", "N_1989sannin")
## [1] "./NORUBY/N_1989sannin2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1722_ruby_24431.zip", "N_1989terasaka")
## [1] "./NORUBY/N_1989terasaka2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1715_ruby_2640.zip", "N_1995ganryu")
## [1] "./NORUBY/N_1995ganryu2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1723_ruby_24430.zip", "N_1989kanei")
## [1] "./NORUBY/N_1989kanei2.txt"
(folder <- getwd())
## [1] "/home/c101003043/c101003043-1"

まとめて解析する

library(RMeCab)
tmp <- paste(folder, "NORUBY", sep = "/")
setwd(tmp)
txts <- dir()
naoki <- data.frame()

for (i in txts) {
    x <- sum(nchar(readLines(i)))
    y <- RMeCabFreq(i)
    kuten <- y[y$Info2 == "句点", ]
    toten <- y[y$Info2 == "読点", ]
    z <- sum(y$Freq)  # / kuten$Freq
    naoki <- rbind(naoki, data.frame(text = i, chars = x, words = z, kuten = kuten$Freq, 
        toten = toten$Freq))
}
## file = N_1989kanei2.txt 
## length = 1369 
## file = N_1989sannin2.txt 
## length = 2843 
## file = N_1989terasaka2.txt 
## length = 1196 
## file = N_1995ganryu2.txt 
## length = 1342 
## file = N_1995kagiya2.txt 
## length = 1604


head(naoki)
##                  text chars words kuten toten
## 1    N_1989kanei2.txt 12643  9006   253  1165
## 2   N_1989sannin2.txt 32616 23470   706  2689
## 3 N_1989terasaka2.txt  9234  6501   222   767
## 4   N_1995ganryu2.txt  7369  5176   163   268
## 5   N_1995kagiya2.txt 11298  7683   275   327

文の長さの中央値を求めてみます。

median(naoki$words/(naoki$kuten + naoki$toten))
## [1] 6.913
median(naoki$chars/(naoki$kuten + naoki$toten))
## [1] 9.607

一文あたりの単語数6.9131 は、また文字数は 9.6071 とわかります。

結果をプロットしてみます。

plot(naoki$words/(naoki$kuten + naoki$toten), main = "一文の単語数", xlab = "作品", 
    type = "l")

plot of chunk unnamed-chunk-9

plot(naoki$chars/(naoki$kuten + naoki$toten), main = "一文の文字数", xlab = "作品", 
    type = "l")

plot of chunk unnamed-chunk-9

unlink(tmp, recursive = T)

菊池寛と直木三十五に文長に違いかあるか調べます。

boxplot(kikuchi$words/(kikuchi$kuten + kikuchi$toten), naoki$words/(naoki$kuten + 
    naoki$toten), name = c("菊池", "直木"))

plot of chunk unnamed-chunk-11

この結果を見る限り、2人の文長に差があるとは言えません。

二人の比較

視点を変えて、二人の作家の助詞および読点の使い分けに差があるかどうかを調べます。

菊池と直木、それぞれのファイルを読み込みます

source("/var/data/AozoraURL.R")

Aozora("http://www.aozora.gr.jp/cards/000083/files/47856_ruby_32271.zip", "K_1970arukoi")
## [1] "./NORUBY/K_1970arukoi2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/496_ruby_19865.zip", "K_1988onsyu")
## [1] "./NORUBY/K_1988onsyu2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/47857_ruby_31986.zip", "K_1970tojuro")
## [1] "./NORUBY/K_1970tojuro2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/492_ruby_19842.zip", "K_1988mumei")
## [1] "./NORUBY/K_1988mumei2.txt"
Aozora("http://www.aozora.gr.jp/cards/000083/files/497_ruby_3051.zip", "K_1988rangaku")
## [1] "./NORUBY/K_1988rangaku2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1069_ruby.zip", "N_1995kagiya")
## [1] "./NORUBY/N_1995kagiya2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1721_ruby_24963.zip", "N_1989sannin")
## [1] "./NORUBY/N_1989sannin2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1722_ruby_24431.zip", "N_1989terasaka")
## [1] "./NORUBY/N_1989terasaka2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1715_ruby_2640.zip", "N_1995ganryu")
## [1] "./NORUBY/N_1995ganryu2.txt"
Aozora("http://www.aozora.gr.jp/cards/000216/files/1723_ruby_24430.zip", "N_1989kanei")
## [1] "./NORUBY/N_1989kanei2.txt"

(folder <- getwd())
## [1] "/home/c101003043/c101003043-1"

まとめて解析する

library(RMeCab)
tmp <- paste(folder, "NORUBY", sep = "/")
setwd(tmp)


x <- docNgram(tmp, type = 0)
## file = /home/c101003043/c101003043-1/NORUBY/K_1970arukoi2.txt Ngram = 2 
## length = 4505 
## 
## file = /home/c101003043/c101003043-1/NORUBY/K_1970tojuro2.txt Ngram = 2 
## length = 5074 
## 
## file = /home/c101003043/c101003043-1/NORUBY/K_1988mumei2.txt Ngram = 2 
## length = 5942 
## 
## file = /home/c101003043/c101003043-1/NORUBY/K_1988onsyu2.txt Ngram = 2 
## length = 7233 
## 
## file = /home/c101003043/c101003043-1/NORUBY/K_1988rangaku2.txt Ngram = 2 
## length = 5319 
## 
## file = /home/c101003043/c101003043-1/NORUBY/N_1989kanei2.txt Ngram = 2 
## length = 4226 
## 
## file = /home/c101003043/c101003043-1/NORUBY/N_1989sannin2.txt Ngram = 2 
## length = 8488 
## 
## file = /home/c101003043/c101003043-1/NORUBY/N_1989terasaka2.txt Ngram = 2 
## length = 3533 
## 
## file = /home/c101003043/c101003043-1/NORUBY/N_1995ganryu2.txt Ngram = 2 
## length = 3803 
## 
## file = /home/c101003043/c101003043-1/NORUBY/N_1995kagiya2.txt Ngram = 2 
## length = 4955

読み込んだ中から、助詞と読点の組み合わせを幾つか抽出する

x <- x[rownames(x) %in% c("[と-、]", "[て-、]", "[は-、]", "[が-、]", 
    "[で-、]", "[に-、]", "[ら-、]", "[も-、]"), ]

####主成分分析を行なってみます。

x <- princomp(t(x))

結果をプロットします。

biplot(x)

plot of chunk unnamed-chunk-16

結論

図から分かるとおり、菊池寛の作品のほとんどが上部、直木三十五の作品が下部に集中しているのがわかります。 菊池は「は‐、」「に‐、」「も‐、」、直木は「ら‐、」「で‐、」「と‐」「て‐」を好んで使用していたのがうかがえます。

unlink(tmp, recursive = T)