How can I change the definitions of words on Mac ver. MeCab? I'm analyzing text data on R but some letters (such as , ", () etc.) are not defined as symbols but as nouns. So I can't exclude these letters because some letters are not treated as characters. For example I want to execute codes as below
df <- df %>%
dplyr::filter(! TERM %in% c("\", """)) # TERM is the variable name.
but this doesn't work since I can't apply ""
to these letters.
So I need to change the definitions of these symbol letters in MeCab dictionary. But I don't know how to do it. This problem must be very elementary but I'm afraid I do not understand the way to open and edit files with Mac terminal.
P.S. Replication data
# code
dput(pilot_data[1:10, "IMAGE_total"])
# output
structure(list(IMAGE_total = c("遠い 難しい 不安",
"国民を動かす討論 世の中を平和に維持する大切なもの 選挙するもの",
"苛立ちの対象だ。 不快なものだ。 悲しいものだ。",
"身近ではない 必要ない 茶番劇である", "難しい物 遠い存在 高みの見物的な物",
"汚いもの 興味深いもの 信用できないもの",
"ダーティーな行為だ うさんくさい世界だ できればかかわりたくないことだ",
"意味がない 敵である 興味がないもの",
"生活に影響してくるもの。 きまりごとをつくるところ 縁のない世界",
"国会議員のもの。 くだらない世界。 金にまみれた世界。"
)), row.names = c(NA, -10L), class = c("tbl_df", "tbl", "data.frame"
))
pilot_data
is the data frame and IMAGE_total
is the answer of open-ended survey question. These Japanese characters may be difficult to treat and I apologize.