WITH#

Is there a culture-sensitive way to define sentences in a string?

Or is there something in the .NET platform (or elsewhere) that provides terminators for specific cultures

For example, if English is spoken ".", "!", "?" (and others) to mark the end of sentences used in China, while Thai uses space.

+3
source share
2 answers

I don’t see how with the material embedded in the framework. One thing you can do is make a series of parsers and choose the right one based on CultureInfo.CurrentCulture. That is, it has a parser that implements a new interface called ISentenceParser and creates many implementations, each of which processes the parsing of sentences in accordance with a particular language. Then, when you need to make out, you will get the one that is necessary for your language.

The best question is why is this necessary? I can think of very few situations where you need to analyze sentences (although maybe I'm just not creative enough).

+4
source

, , . . ?

-1

Source: https://habr.com/ru/post/1778543/


All Articles