Anyone has idea to seperate a word in parts for example ( kalemimin -> kalem-i-min )
'kalem' is str1 , 'i' in str2 and 'min' should be get into str3.

Dani AI

Generated

Short practical plan that builds on ’s goal and answers ’s lexicon question: Turkish segmentation is a small morphological-analysis problem, not just string-splitting. A reliable C++ solution needs (1) a stem lexicon or morphological model and (2) rules/transformations for suffix forms (vowel harmony, consonant alternation, buffer vowels). Without those you will get many false splits.

Suggested approach (keeps implementation complexity manageable)

  • Prepare a stem dictionary (word list with frequencies if possible).
  • Encode suffix inventory as canonical morphemes plus their surface variants (use vowel-harmony variants and optional linking vowels).
  • Implement a recursive/backtracking splitter that tries candidate stem boundaries, applies reverse morphophonological transforms to recover possible stems, checks the stem against the lexicon, and then validates the remaining suffix sequence against allowed suffix patterns.
  • Score candidates (prefer dictionary hits, longer stems, higher-frequency stems) and memoize to avoid exponential blowup.

Implementation tips for C++

  • Store stems in a Trie for O(length) prefix checks.
  • Precompile suffix patterns or use a finite-state transducer for robust matching (tools below).
  • Cache intermediate results and return the best-scoring segmentation(s). Expect ambiguities; provide n-best outputs if needed.

Tools and references

A lightweight prototype using longest-match + harmony rules will work for many words; for production, use an FST-based analyzer or an existing Turkish morphological resource.

Recommended Answers

All 3 Replies

Could you explain on what basis these need to be separated? i mean from your example, i didn't understand how you need to separate the word. is it based on an indices?

commented: Explained below.. +0

You will write a C++ program that will take a Turkish word from the user and separate the word into root and suffixes. An example run of the program is as follows:
Enter the word:
arabaların

Analysis:
araba : root
-lar : prular
-ın : ownership

Do you have some way to find if a word is a root word? I mean you would have some list of words showing which ones are root, etc. right? Provide more details since all we know about the problem is the 3-4 lines you have provided us :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.