Like Tree1Likes
  • 1 Post By memcpy

My crude sentence generator

This is a discussion on My crude sentence generator within the C Programming forums, part of the General Programming Boards category; Hi, I made a word generator that got a random word from a list of words, and that seemed to ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    229

    My crude sentence generator

    Hi, I made a word generator that got a random word from a list of words, and that seemed to work ok.
    Then i updated my word list and started to generate sentences, but these sentences aren't in a line like a real sentence,
    but are in a stack of four words placed below 4 percentages.
    Then I use the percentages to guess which of the four words best matches the intention the sentence was trying to convey.

    So a lot of guessing.

    Obviously the stacked four words aren't going to read like a read sentence, they are like slang in a sense in that they aren't a formal english sentence.
    i did this for my chat-bot project which I left and thought how hard it would be for somebody else to do this so I went and did it and am now giving it to you or whomever for their chat-bot project.

    So enough of the introduction I will now show you an example of the program running so you can read the output yourself and see if it makes and sense.

    Code:
    Input a sentence. Press Enter when done.
    
    German authorities apparently use silent SMS to create a movement profile of sus
    pects or locate their position. SMS pings are received by a cellphone, but the u
    ser will not be notified of it. However, the cellphone carrier will record the d
    ata in a log, which can be requested by the government. While the data do not pr
    ovide information about the phone, they do deliver location data via the cell to
    wers that were used when the silent SMS was sent.
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
    german authorities apparently use silent sms to create a movement profile of sus
    pects or locate their position.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    german authorities apparently use silent sms to create movement profile suspects
     locate their position
    
    
    The last word is: position
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.571429
    letter vowel vowel 0.214286
    vowel vowel letter 0.071429
    vowel vowel vowel 0.142857
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: position,
    these are four possible word associations:
    
    Algren N
    
    catenated t
    
    beef NitV
    
    Abyssinian banana h
    
    The result using Analysis part ones data is: catenated t
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     sms pings are received by a cellphone, but the user will not be notified of it.
    
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    but the not notified it
    
    
    The last word is: it
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.400000
    letter vowel vowel 0.400000
    vowel vowel letter 0.200000
    vowel vowel vowel 0.000000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: it,
    these are four possible word associations:
    
    Anteros N
    
    ambush NVt
    
    bivouacked V
    
    Abyssinian banana h
    
    The result using Analysis part ones data is: ambush NVt
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     however, the cellphone carrier will record the data in a log, which can be requ
    ested by the government.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    however the cellphone carrier record the data in log can requested the governmen
    t
    
    
    The last word is: government
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.538462
    letter vowel vowel 0.384615
    vowel vowel letter 0.076923
    vowel vowel vowel 0.000000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: government,
    these are four possible word associations:
    
    Ashleigh N
    
    abnormalizing t
    
    appraise tV
    
    Abney level h
    
    The result using Analysis part ones data is: abnormalizing t
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     while the data do not provide information about the phone, they do deliver loca
    tion data via the cell towers that were used when the silent sms was sent.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    the data not information about the phone they location data the towers that used
     when the silent sms was sent
    
    
    The last word is: sent
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.450000
    letter vowel vowel 0.400000
    vowel vowel letter 0.100000
    vowel vowel vowel 0.050000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: sent,
    these are four possible word associations:
    
    Algren N
    
    abnormalising t
    
    automobile NV
    
    Abney level h
    
    The result using Analysis part ones data is: abnormalising t
    
    _______________________________________________________________
    _______________________________________________________________
    
    Press any key to continue . . .
    The input sentence is a quote snippet from tomshardware article.

    here is the link to the source and program, the file the program reads to get words was from 'kevins word list' and I used the 'Part Of Speech Database' and edited the file so the program could read the last letter which shows what type of grammar it is.
    Thought generator.zip

    Here is the legend to decode the letters at the end of the word:

    Code:
    N	Noun
    P	Plural
    h	Noun Phrase
    V	Verb (usu participle)
    t	Verb (transitive)
    i	Verb (intransitive)
    A	Adjective
    v	Adverb
    C	Conjunction
    P	Preposition
    !	Interjection
    r	Pronoun
    D	Definite Article
    I	Indefinite Article
    o	Nominative
    I'll upload the source and the file it reads from is too big to upload so you have to get it from the attached link.

    corgi.zip.txt

    Now the result, the words below the percenteges, isnít fluent english and is barely a sentence, itís a pretend sentence, but it shows grammar in the words that are generated.

    I suppose if somebody was industrious they could scale it up to sophistication.

    So have a look at the source, dl the text file and try out the program.
    It's a toy to me, but what you'll think about it I don't know.

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Seriously, do you have to upload everything as "corgi.zip.txt"? ._.

    The program itself is much better in regards to copy/pasted stuff, there's a couple areas that could be improved, but mainly it's a lot better. I'd make these changes to make it even better:

    ---------

    Code:
    	char red[] = "one";
    	char green[] = "two";
    	char blue[] = "three";
    	char yellow[] = "four";
    Confusing names aside, these are only being used once in the strcoll() calls, and therefore no reason to declare them at the top of your function.

    ---------------

    Code:
    	char * pch = malloc(4096);
    	char * list_of_words = malloc(4096);
    	char * last = malloc(4096);
    	char * letters = malloc(4096);
    	char * whole_consonant_words = malloc(4096);
    	char * last_string = malloc(4096);
    	char * words = malloc(4096);
    	char * one_word = malloc(4096);
    	char * calculation = malloc(4096);
    Still ridiculously wasteful of memory, and "one_word" isn't even being used.

    ---------------


    Code:
    	float one;
    	float two;
    	float three;
    	float four;
    	float total;
    	float five;
    	float six;
    	float seven;
    	float eight;
    	float total_2;
    	float percentage_1;
    	float percentage_2;
    	float percentage_3;
    	float percentage_4;
    
    
    	one = 0;
    	two = 0;
    	three = 0;
    	four = 0;
    	total = 0;
    	five = 0;
    	six = 0;
    	seven = 0;
    	eight = 0;
    	percentage_1 = 0;
    	percentage_2 = 0;
    	percentage_3 = 0;
    	percentage_4 = 0;
    Try using arrays:

    Code:
            float numbers[8];
            float percentages[4];
            memset(numbers, 0, 8 * sizeof(float));
    Also, what's the point of having them all floats when they're not doing any floating point arithmetic? Only the percentages need to be stored as float, everything else as int/short/char and typecasted for calculation.

    -------------

    You have unused variables and messed up "if" statements littered around the whole program. Use GCC with some flags ("-Wall -pedantic" for a few) to spot where they are and fix them.

    --------------

    Code:
    char find_letter (char* a, char* b)
    {
    	char string = strlen(b);
    	strncpy (a,b,1);
    	a[1]='\0';
    	return 0;
    }
    This is still wrong. I even gave you a prototype for how the function should look in your last thread. If the function is truly to find the first letter in a word as the comment said, it should (a) return such letter, and (b) not use strcpy or strlen when "return a[0]" is sufficient.

    -----------

    Your function "redefined_sentence" is a large mess of spaghetti code, made worse by not adhering to the rule that "a function should do one thing and do it well", and goto's sprinkled liberally throughout. The fact that it's 255 lines should be a dead giveaway to this.
    Salem likes this.

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    229
    I wasn't happy with the programs output so I have been busy fixing that.

    Here are the new results:

    Code:
    Input a sentence. Press Enter when done.
    
    German authorities apparently use silent SMS to create a movement profile of sus
    pects or locate their position. SMS pings are received by a cellphone, but the u
    ser will not be notified of it. However, the cellphone carrier will record the d
    ata in a log, which can be requested by the government. While the data do not pr
    ovide information about the phone, they do deliver location data via the cell to
    wers that were used when the silent SMS was sent.
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
    german authorities apparently use silent sms to create a movement profile of sus
    pects or locate their position.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    german authorities apparently use silent sms to create movement profile suspects
     locate their position
    
    
    The last word is: position
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.571429
    letter vowel vowel 0.214286
    vowel vowel letter 0.071429
    vowel vowel vowel 0.142857
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: position,
    these are four possible word associations:
    
    its D
    
    Int Rev h
    
    amidst P
    
    Death N
    
    The result using Analysis part ones data is: Death N
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     sms pings are received by a cellphone, but the user will not be notified of it.
    
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    but the not notified it
    
    
    The last word is: it
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.400000
    letter vowel vowel 0.400000
    vowel vowel letter 0.200000
    vowel vowel vowel 0.000000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: it,
    these are four possible word associations:
    
    its D
    
    Phil I h
    
    amidst P
    
    Ibsenism N
    
    The result using Analysis part ones data is: Ibsenism N
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     however, the cellphone carrier will record the data in a log, which can be requ
    ested by the government.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    however the cellphone carrier record the data in log can requested the governmen
    t
    
    
    The last word is: government
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.538462
    letter vowel vowel 0.384615
    vowel vowel letter 0.076923
    vowel vowel vowel 0.000000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: government,
    these are four possible word associations:
    
    her rD
    
    GI tag h
    
    among P
    
    Covell N
    
    The result using Analysis part ones data is: Covell N
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     while the data do not provide information about the phone, they do deliver loca
    tion data via the cell towers that were used when the silent sms was sent.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    the data not information about the phone they location data the towers that used
     when the silent sms was sent
    
    
    The last word is: sent
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.450000
    letter vowel vowel 0.400000
    vowel vowel letter 0.100000
    vowel vowel vowel 0.050000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: sent,
    these are four possible word associations:
    
    her rD
    
    Ivan IV h
    
    amongst P
    
    Demus N
    
    The result using Analysis part ones data is: Demus N
    
    _______________________________________________________________
    _______________________________________________________________
    
    Press any key to continue . . .
    I tweaked the code a bit. Here is the link to the new source and program:Thought generator_2.zip

    I had to work on the results a bit to get it to look this good. Try the program and input your own sentences and post the results.


    corgi.zip.txt

    Thanks for the tips. They aren't being used yet because I was busy doing this update, but I will look at them again later. Time to rest a bit.

  4. #4
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,427
    You're incorrectly identifying parts of speech. Do you fully understand what all the parts of speech are and did you actually test your output?

    • You use uppercase P for plural and preposition, so I can't tell if "amidst", "among" and "amongst" are labeled correctly.
    • "its" is not a definite article
    • I'm not really sure what "Int Rev" is, but I sure can't see how it's a noun phrase
    • "Phil" is neither an indefinite article or a noun phrase, it's a proper noun.
    • "her" is not a definite article
    • You have uppercase V for verb (usu participle) and adverb. Either way, "Ivan" is neither. Also, Ivan is not an indefinite article or noun phrase. It's a proper noun.

  5. #5
    Registered User
    Join Date
    Apr 2011
    Posts
    229
    Code:
    Input a sentence. Press Enter when done.
    
    This should come as a great relief to anyone planning a quantum computer self-bu
    ild: wires still conduct electricity and obey key laws of classical physics even
     when they're built at the nanoscale. Researchers at Purdue and Melbourne univer
    sities used chains of phosphorus atoms inside a silicon crystal to create a wire
     that's just four atoms wide and a single atom high -- 20 times smaller than the
     previous record-holder and infinitely narrower than anything you'd find at Newe
    gg. The video after the break almost explains how they did it.
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
    this should come as a great relief to anyone planning a quantum computer self-bu
    ild: wires still conduct electricity and obey key laws of classical physics even
     when they're built at the nanoscale.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    this should come as relief anyone planning quantum computer selfbuild wires stil
    l conduct electricity and laws classical physics even when built nanoscale
    
    
    The last word is: nanoscale
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.636364
    letter vowel vowel 0.136364
    vowel vowel letter 0.136364
    vowel vowel vowel 0.090909
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: nanoscale,
    these are four possible word associations:
    
    Balsam N
    
    bedevil V
    
    cosset tNV
    
    aptly v
    
    The result using Analysis part ones data is: cosset tNV
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     researchers at purdue and melbourne universities used chains of phosphorus atom
    s inside a silicon crystal to create a wire that's just four atoms wide and a si
    ngle atom high -- 20 times smaller than the previous record-holder and infinitel
    y narrower than anything you'd find at newegg.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    and melbourne universities chains inside silicon wire wide and single high than
    and infinitely narrower than anything find newegg
    
    
    The last word is: newegg
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.421053
    letter vowel vowel 0.210526
    vowel vowel letter 0.263158
    vowel vowel vowel 0.105263
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: newegg,
    these are four possible word associations:
    
    Benisch N
    
    bevelled V
    
    dight V
    
    blandly v
    
    The result using Analysis part ones data is: dight V
    
    _______________________________________________________________
    _______________________________________________________________
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
     the video after the break almost explains how they did it.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    the after the almost they it
    
    
    The last word is: it
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.000000
    letter vowel vowel 0.500000
    vowel vowel letter 0.500000
    vowel vowel vowel 0.000000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: it,
    these are four possible word associations:
    
    Bothe N
    
    bilged V
    
    drill in V
    
    briskly v
    
    The result using Analysis part ones data is: briskly v
    
    _______________________________________________________________
    _______________________________________________________________
    
    Press any key to continue . . .
    from the article: This electric wire is four atoms thick, and you thought speaker cable was fiddly (video) -- Engadget

    here is the link to download the program and source: Thought generator_3.zip


    The way I did this is to create a template then tweak the code to get results. This is my template:

    Code:
    if( vowel_count < 3 && letter_count > 1 && strpbrk(filedata, c) && strpbrk(filedata, "i") )
    The template has three parts:
    a.) The letter and vowel count. The vowel in the word is feminine and the consonant is masculine. But tweaking the amount of feminine in the word the type of word is dial-able from wordy to spartan and everything in-between.
    b.) The use of 'e' and 'e'. The 'e' is passive and the 'i' is active in words. So I brought in words that had these so there is a type of 'on' 'off' to the word, 'i = on' 'e = off'.
    c.) Then I included something from the other word, be that a word generated or the source word, to give some randomness to the results.

    The rest was tweaking the results of each word so the output was acceptable for every entry input to the program I tried.

    As far as making the program into more functions I haven't gotten around to that, as I have been busy getting this code made.
    Since I probable won't be updating the code anymore and nobody will use my source I have no reason to make more functions from the source to clean it up.
    So I'm quite happy with leaving it as is. This code and project is a toy to me, and nobody else probably even tried it out yet, and never will.
    I dunno, maybe I'm being negative in my attitude, but I don't feel negative about just leaving the code as is.
    What I think is a better idea is to learn C then go through my code and fix each one then, rather then get it second hand from you kind people as to what is wrong with it.

    anduril462,

    I didn't make the word list that generates the words with the grammar beside it, I got the list from 'Kevin' word list', he got it from a prestigious university who the read-me says I can't identify, so go read the read-me to see who made it.

    corgi.zip.txt

  6. #6
    Registered User
    Join Date
    Apr 2011
    Posts
    229
    This post explains the programs output to one of the sentence in the previous post I made.

    First, this sentence, was used:
    'the video after the break almost explains how they did it.'

    Second, this sentence was made into a shortened version:
    'the after the almost they it'

    Third, this made the percentages:
    letter vowel letter 0.000000
    letter vowel vowel 0.500000
    vowel vowel letter 0.500000
    vowel vowel vowel 0.000000

    Fourth, Taking the last word 'it' these words were made:
    Bothe N

    bilged V

    drill in V

    briskly v

    Fifth, taking the percentages the word in the fourth step that best matches the sentence 'the video after the break almost explains how they did it.' is 'briskly'.

    Sixth, taking the four word the program generated without their grammar, this is the sentence:
    "Bothe bilged drill in briskly."

  7. #7
    Registered User
    Join Date
    Apr 2011
    Posts
    229
    Hi, I got my rest and decided to clean up my code a bit, so it's been divided into more functions so each function is really easy to understand now.

    And I have updated the program a bit.
    First I have the if statement tweaked a bit, it's now this:

    Code:
    char some_letters[] = "dgjlpsv";
    if( vowel_count < 3 && letter_count > 1 && strpbrk(filedata, some_letters) && strpbrk(filedata, c) )
    Where filedata is the word from the dictionary, some_letters is a bunch of letters I chose randomly, and 'c' is the last word in the sentence.
    So the if conditions are:
    a.) vowel and consonant count
    b.) letters I picked.
    c.) the original word from the sentence, to add randomness.

    The goal in the four words the program generates is to have different phonetic enunciation's, three or two at least.
    So the first word has a opposite phonetic sound from the fourth word displayed in the list of four in the console window.

    Here is a example of the new program:

    Code:
    Input a sentence. Press Enter when done.
    
    Textron previously said that that it is considering legal action over the unlice
    nsed use of its trademarks for the AH-1Z, UH-1Y and V-22 Bell helicopters in the
     video game.
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
    textron previously said that that it is considering legal action over the unlice
    nsed use of its trademarks for the ah-1z, uh-1y and v-22 bell helicopters in the
     video game.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    considering legal trademarks game
    
    
    The last word is: game
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.750000
    letter vowel vowel 0.250000
    vowel vowel letter 0.000000
    vowel vowel vowel 0.000000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: game,
    these are four possible word associations:
    
    in brief v
    
    Krebs cycle h
    
    blitzkrieg NV
    
    brotherly Av
    
    The result using Analysis part ones data is: brotherly Av
    
    _______________________________________________________________
    _______________________________________________________________
    
    Press any key to continue . . .
    This sentence was generated: "in brief Krebs cycle blitzkrieg brotherly".

    so 'in brief' has a different phonetic sound than 'brotherly'. If the four words transition the sound from the first word to the fourth word gradually the sentence should make some sense.
    That is assuming the right grammar is chosen for each of the four words.
    Then there's the concept of the flying ducks migrating forming a 'v', with the tip of 'v' being the word I use since it has the best chance of being a nice rhyming word with the other words.

    Right now the program only works with one sentence, when I input multiple sentences only the first one sentence works.

    I'm was at learning C++ then going to Qt to port this to that, but right now I'm just going to play video games.
    There's little point to going to all that trouble if it's just a simple port with no improvement, so I don't know where to go from here with the program.

    Here's another example of the program running:
    Code:
    Input a sentence. Press Enter when done.
    
    joy.
    
    
    __________________
    __________________
    
    An input sentence is converted to lower case:
    __________________
    
    joy.
    
    
    __________________
    
    The secret message in the sentence:
    __________________
    
    joy
    
    
    The last word is: joy
    __________________
    
    Analysis part one:
    __________________
    
    
    letter vowel letter 0.000000
    letter vowel vowel 1.000000
    vowel vowel letter 0.000000
    vowel vowel vowel 0.000000
    
    Analysis part two:
    __________________
    
    Using the last word of the sentence: joy,
    these are four possible word associations:
    
    feeble-mindedly v
    
    Peter Ibbetson h
    
    bottling V
    
    bountifully v
    
    The result using Analysis part ones data is: feeble-mindedly v
    
    _______________________________________________________________
    _______________________________________________________________
    
    Press any key to continue . . .
    This sentence was generated: "feeble-mindedly Peter Ibbetson bottling bountifully".
    In reference to the book character 'Peter Ibbetson'. Peter used his dreams to meet his girlfriend then she dies and doesn't come to meet him anymore in his dream.

    here's the link to the new program and source:

    <a href="http://www.mediafire.com/?n6ss7njh47cbju7">link</a>

    The program is not complete. I get one step done then go to the next.
    The first this I did was generate a random word.
    Then I get multiple words generated.
    Then I found the if statement conditions I mentioned before and in this reply.
    Then I found the phonetic sound each of the four words needs so the four words together might make sense.

    It's true that I don't have a real chatbot, but it makes semi-sense in it's output in it's current condition.

    Watson is just a chatbot in that it is a fancy thesaurus. it finds the thesaurus type answer to the questions it's given.
    chess AI is a chatbot too in that from each position there is another position that is as logical as a thesaurus would describe it.
    So AI as it stands is just a fancy thesaurus, it reads what is logical from a selected options.

    A human mind has psychology where images are perceivable and imaginations describable based uniquely on the user or viewer, that not a thesaurus that's intelligence.
    My program uses a list of words in a dictionary and from any word it outputs some form of thought in it's four word sentence.
    The thought, or four words my program outputs isn't like a thesaurus, you have to imagine what it's describing.
    It's thinking like a human in that a human has to think creatively to understand it's 4 words.

    Just delete the txt extension then unzip it to get the source file.
    corgi.zip.txt

    So I'm not asking for the program to be tweaked anymore. I did this to follow what I was told in that functions should not be very big, so I tried to fix that and I fixed that broken function you told me about.
    What I want to do is learn C then go through the file I just upload and look for errors myself.

    I'm just posting this to tell you I have tried to do what you told me and here is my work if you want to see it.

  8. #8
    Registered User
    Join Date
    Nov 2011
    Posts
    63
    I haven't really posted in any of your threads because I honestly don't understand anything about your program, but I've been following this over the weeks. So just because very few people are posting in your threads doesn't mean nobody is interested in your work. Anyways, I recompiled and ran your program on a Linux machine. I entered the sentence:

    Hello, we are beginning!
    The program got this far and then it crashed:

    Input a sentence. Press Enter when done.

    Hello, we are beginning!


    __________________
    __________________

    An input sentence is converted to lower case:
    __________________

    hello, we are beginning.
    *** glibc detected *** ./corgi: double free or corruption (top): 0x08156198 ***
    Then I tried running the program again with

    Why did you crash?
    and I got the same exact error:

    Input a sentence. Press Enter when done.

    Why did you crash?


    __________________
    __________________

    An input sentence is converted to lower case:
    __________________

    hello, we are beginning.
    *** glibc detected *** ./corgi: double free or corruption (top): 0x09c2d198 ***
    I didn't even type in "Hello, we are beginning" this time and it still showed up. It's pretty late right now, so I can't look at what's causing all of this, but I do recommend you to continue studying C and not to give up.
    Last edited by failure67; 01-13-2012 at 01:45 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My sentence generator, it's not finished though.
    By jeremy duncan in forum C Programming
    Replies: 6
    Last Post: 12-07-2011, 03:33 PM
  2. Sentence to a list , need help
    By louiehook in forum C++ Programming
    Replies: 4
    Last Post: 02-17-2011, 05:38 AM
  3. Random Sentence Generator
    By jlangfo5 in forum General AI Programming
    Replies: 1
    Last Post: 10-13-2010, 01:22 PM
  4. Help with parsing a sentence.
    By w2look in forum C Programming
    Replies: 20
    Last Post: 02-22-2009, 06:09 PM
  5. random sentence generator
    By jsbeckton in forum C Programming
    Replies: 19
    Last Post: 10-14-2005, 04:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21