R R !!!quanteda: Quantitative Analysis of Textual Data https://rdrr.io/cran/quanteda/ {{pre install.packages("quanteda", dependencies=T) library(quanteda) }} *コーパスを構築してコーパスデータとして扱う **tmpにテキストファイルが入っているとして tmp.cor <- corpus(tmp) *コーパスデータの概要を見る summary(tmp.cor) *コーパスデータの中身を見る texts(tmp.cor) *KWIC検索をする kwick(tmp.cor, pattern = "文字列") ---- {{pre > tmp.cor <- corpus(tmp) > tmp.cor Corpus consisting of 1 document and 0 docvars. > summary(tmp.cor) Corpus consisting of 1 document: Text Types Tokens Sentences text1 120 233 9 Source: C:/Users/hpsg/Documents/* on x86-64 by sugiura Created: Thu Nov 14 14:40:11 2019 Notes: > texts(tmp.cor) text1 "Computer Terminal Systems Inc said\nit has completed the sale of 200,000 shares of its common\nstock, and warrants to acquire an additional one mln shares, to\n of Lugano, Switzerland for 50,000 dlrs.\n The company said the warrants are exercisable for five\nyears at a purchase price of .125 dlrs per share.\n Computer Terminal said Sedio also has the right to buy\nadditional shares and increase its total holdings up to 40 pct\nof the Computer Terminal's outstanding common stock under\ncertain circumstances involving change of control at the\ncompany.\n The company said if the conditions occur the warrants would\nbe exercisable at a price equal to 75 pct of its common stock's\nmarket price at the time, not to exceed 1.50 dlrs per share.\n Computer Terminal also said it sold the technolgy rights to\nits Dot Matrix impact technology, including any future\nimprovements, to of Houston, Tex. for 200,000\ndlrs. But, it said it would continue to be the exclusive\nworldwide licensee of the technology for Woodco.\n The company said the moves were part of its reorganization\nplan and would help pay current operation costs and ensure\nproduct delivery.\n Computer Terminal makes computer generated labels, forms,\ntags and ticket printers and terminals.\n Reuter" > kwic(tmp.cor, pattern="for") [text1, 39] > of Lugano, Switzerland | for | 50,000 dlrs. The company [text1, 50] said the warrants are exercisable | for | five years at a purchase [text1, 171] of Houston, Tex. | for | 200,000 dlrs. But, [text1, 191] worldwide licensee of the technology | for | Woodco. The company said }}