tokenizedDocument withe special caharcters

19 次查看(过去 30 天)
How can use "TokenizedDocument" method to Tokenize text with special characters and case sensetive. I need to keep them as they are and use only space as a stoppings character. for example:
"c1ccc2Nc3ccccc3C Nc2c1C"
there are tow tokenz : "c1ccc2Nc3ccccc3C" and "Nc2c1C"
Thanks

回答(1 个)

Ravi Chaitanya
Ravi Chaitanya 2022-12-29
编辑:Ravi Chaitanya 2022-12-29
Hello Said,
As per my understanding, you want to tokenize text with special characters and case sensitive letters and want to retain the grouping and case sensitivity of text in the tokenized output.
One of the ways to achieve that is by specifying custom tokens as an argument to "tokenizedDocument" function. The code snippet below shows an example:
str="I am a BeGiNnEr in C# , C++"
documents = tokenizedDocument(str,'CustomTokens',["C++" "C#"])
In the output, it can be observed that the case sensitivity of the characters is retained(this is by default) and the custom tokens specified C# and C++ are not tokenized.
Please refer to the MathWorks documentation on tokenizedDocument to know more about other options available for special characters handling.

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by