Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:40:36+00:00 2026-06-13T10:40:36+00:00

I need to be able to process one word or words and verify that

  • 0

I need to be able to process one word or words and verify that it has valid syllables. There are some syllabification rules that could be used:

V CV VC CVC CCV CCCV CVCC

where V is a vowel and C is a consonant. e.g.,

pronunciation (5 Pro-nun-ci-a-tion; CCV-CVC-CV-V-CVC)

Or is there a simple code that can be used, or a library in c++? In class we’re talking about binary search trees, hash tables, etc, but i can’t really see the relation. Any help would appreciated, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:40:37+00:00Added an answer on June 13, 2026 at 10:40 am

    Whenever we have collected a full pattern-string, we can either discard it and begin collecting to a new pattern-string, or keep it and try to get a longer pattern-string. We don’t know in advance (without examining the rest of the input-string), whether we should keep or discard the current string, so we need to keep both possibilities in mind.

    We can build a state machine that can keep track of this for us. The base-states are identified by the sequence of characters we have examined so far:

    State   C           V
    ""      {"C"}       {"V",""}
    "C"     {"CC"}      {"CV",""}
    "CC"    {"CCC"}     {""}
    "CCC"   {}          {""}
    "CV"    {"CVC",""}  {}
    "CVC"   {""}        {}
    "V"     {""}        {}
    

    Since we don’t always know which action to take, we can be in several possible states at once. Those sets of possible states form super-states:

    Index   Super-state        C    V
        0   {}                 0    0   Fail 
        1   {""}               2    9   Accept 
        2   {"C"}              3    8
        3   {"CC"}             4    1
        4   {"CCC"}            0    1
        5   {"","C"}           6   13   Accept
        6   {"C","CC"}         7    8
        7   {"CC","CCC"}       4    1
        8   {"","CV"}         12    9   Accept
        9   {"","V"}           5    9   Accept
       10   {"","C","CC"}     11   13   Accept
       11   {"C","CC","CCC"}   7    8
       12   {"","C","CVC"}    10   13   Accept
       13   {"","CV","V"}     12    9   Accept
    

    The transitions are between super-states. Each member of the super-state is advanced with the same symbol. All members without such transition are discarded. If a member has two possible destinations, both are added to the new super-state.

    You might notice that some rows are very similar. Super-state 3 and 7 have the same transitions. As are 6 and 11, and 8 and 13. You could collapse those into one state each, and update the indices. I’m not going to demonstrate that here.

    This could easily be encoded into a programming language:

    //                    index = 0  1  2  3  4   5  6  7   8  9  10  11  12  13
    int[] consonant = new int[] { 0, 2, 3, 4, 0,  6, 7, 4, 12, 5, 11,  7, 10, 12 };
    int[] vocal = new int[] {     0, 9, 8, 1, 1, 13, 8, 1,  9, 9, 13,  8, 13,  9 };
    int[] accept = new int[] {    0, 1, 0, 0, 0,  1, 0, 0,  1, 1,  1,  0,  1,  1 };
    int startState = 1;
    int failState = 0;
    
    bool CheckWord(string word)
    {
        int state = startState;
        foreach (char c in word)
        {
            if (IsVocal(c))
            {
                state = vocal[state];
            }
            else if (IsConsonant(c))
            {
                state = consonant[state];
            }
            if (state == failState) return false;
        }
        return accept[state] != 0;
    }
    

    Example:

    > CheckWord("pronunciation")
    true
    
    > CheckWord("pronunciationn")
    false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need my parent and child process to both be able to read and
I'm very new to JSON, and I need to parse some that an API
Is there an Erlang equivalent of the Java SocketChannel class? Need to be able
I need to export some process data from my jBPM database, and I should
I need to be able to have one submit button for multiple forms. I
I need to be able to launch a browser window from VBA code (that
Users of the website need to able to store images in their area ,
Need to be able to pull Magento products into an external template. Need to
I need to be able to access a list throughout my Rails project. For
I need to be able to search through multiple 2D arrays and search the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.