Develop this program was set at the 3 course on the discipline "Processing of natural language".

First, the file should contain a file with a list of words (about 200), in which the emphasis has already been placed. Then the word is entered from the specified list or any other. And it is necessary that the program issued its transcription.

Prompt at least one cycle to process a word and check it for transcription rules. Language - C ++, Wednesday: Visual Studio 2008.

  • What transcription are we talking about? Phonetic, ordinary transliteration? Any other? What language is the word? Can you also specify a specific algorithm that should be used? - Nikolay Artamonov
  • namely phonetic, words in Russian - the rules of transcription of the Russian language should be used. We were not given an algorithm, I wanted to ask here - gvenog

1 answer 1

I do not see a particular problem. First you need to define the transformation rules. And then already to dance from them. In the simplest version, where only the options "x" -> "y" and "z" -> "ab" are possible, you can simply go along the line from left to right and replace all suitable combinations of characters. If more complex analysis is needed (for example, the dependence of phonetics on the closure of a syllable), then a more complex algorithm can be invented. But again, for implementation, you need to have and introduce this very algorithm. And in what language to implement it - this is a technical question.

As good tools, I can suggest the boost :: regex library and the std :: replace algorithm. In standard C, I would send it to <string.h> .

The necessary information on the phonetics of the Russian language probably makes sense to take from Wikipedia: Russian and Russian phonetics .

  • one
    thanks, I will look at the libraries at least, otherwise they were assigned a task, but they didn’t explain how to implement it - gvenog
  • one
    "you can just go along the line from left to right" - tell me what function, otherwise we haven’t done this - gvenog
  • <pre> char x [1024]; // Your string char * p = & x; // pointer to your string for (char * i = p; * i! = 0; i ++) // go along the line from left to right until you find a character with code 0 {switch (* i) {case 'a':. ...; case 'b': ...} // see what our smmvol is and depending on this we do different things. } </ pre> - gecube
  • 2
    I note that the "dance" should start from a specific phonetic systems. As far as I know, there are several of them, and they are complex: there is no simple mapping of letters of a word to phonemes, but you need to analyze the position of the letters, their neighbors, and so on. Depending on the position of the letter in the word, its neighboring letters and other conditions, one or two phonemes may correspond to it. In short, one must go to the library and look for relevant literature on the phonetics of the Russian language. And then think how to express the rules of transcription in C ++. - Nikolay Artamonov
  • one
    Thus, based on the discussion, it turned out that this task is divided into 2 small stages. 1) Development of a language (notation system) describing the conversion of arbitrary sequences of Cyrillic characters into phonemes of the Russian language. 2) Writing an interpreter (compiler) of a given language, receiving hints on stress from a user-specified file. - avp