数音节 [英] Counting syllables

查看:28
本文介绍了数音节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望为 R 中的文本(例如 Flesh Kincaid)分配一些不同的可读性分数.

I'm looking to assign some different readability scores to text in R such as the Flesh Kincaid.

有谁知道使用 R 将单词分割成音节的方法?我不一定需要音节段本身,而是需要计数.

Does anyone know of a way to segment words into syllables using R? I don't necessarily need the syllable segments themselves but a count.

例如:

x <- c('dog', 'cat', 'pony', 'cracker', 'shoe', 'Popsicle')

会产生:1, 1, 2, 2, 1, 3

would yield: 1, 1, 2, 2, 1, 3

每个数字对应单词中的音节数.

Each number corresponding the the number of syllables in the word.

推荐答案

此处提供了一些 NLP 工具:

Some tools for NLP are available here:

http://cran.r-project.org/web/views/NaturalLanguageProcessing.html

不过,这项任务并不简单.更多提示(包括您可以实现的算法):

The task is non-trivial though. More hints (including an algorithm you could implement) here:

检测单词中的音节

这篇关于数音节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆