powered by
Convert entire files into Pinyin
file2py(folder = "py", backup = TRUE, method = c("quanpin", "tone", "toneless"), sep = " ", nonezh_replace = NULL, only_first_letter = FALSE, multi = FALSE, encoding = "UTF-8")
character. The folder in which the files are to be converted.
logical. Whether the original files should be saved as backups.
character. The value can be:
'quanpin', for the standard form of pinyin (tones above letters),
'tone', for tones expressed with numbers,
'toneless', without tones
character. Seperation between the converted pinyin.
NULL or character. Define how to convert non-Chinese characters in mychar. NULL means 'let it be'.
logical. Wheter only the first letter in pinyin.
logical. Whether display multiple pronounciations of a Chinese character or only the first pronounciation.
character. The encoding of the input files. 'UTF-8' by default.
files converted to Pinyin.
# NOT RUN { mydir <- paste0(tempdir(), "/py") dir.create(mydir) file.create(paste0(mydir, "/test.txt")) writeLines(text = "test\n", paste0(mydir, "/test.txt")) file2py(mydir) # }
Run the code above in your browser using DataLab