By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,406 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,406 IT Pros & Developers. It's quick & easy.

Honest help

P: 27
Hello friends i have to do the following thing and i am still learning ANSI C .
Can anyone tell me how to go about it . please.
write a program to provide predictive text input. As a user types words of a sentence the application should suggest (attempt to predict) the word to be typed.
The user should be given the option of selecting the predicted word input or continuing to input the word.
A typical output is shown below. Bold represents user inputs. Note after each prompt from the application a new line of text is output.

T the-1, there-2, that-3, select or continue! 1
The c cat-1 coat-2, select or continue! o
The co cook-1 clock-2, cot-3, select or continue! s

Guide :
Create a file to hold a dictionary of words. (use notepad to create the file.)

I must create and use a number of functions.

I must use pointers when comparing strings, and cant use the library function strcmp.

I am free to make sensible assumptions/modifications to the specification in order to improve my program.
Nov 7 '06 #1
Share this Question
Share on Google+
6 Replies

P: 27
anyone can help me with this ? please.
Nov 8 '06 #2

Expert Mod 2.5K+
P: 4,677
anyone can help me with this ? please.
Is this supposed to be updated in realtime? That would be rather difficult, I don't think I understand how the users will be shown the predictive options.

Will they put the first letter of the word in, and then press enter to see them, or is it supposed to come up automatically? Are they only limited to the words you include in the notepad, or are they supposed to be able to add more?
Nov 8 '06 #3

P: 27
No its only 4 the line i have in my text file . for example

Java is the best . ------- is the line .

is users start .

J --- they have a option--> 1 -just , 2 -joke , 3 - jam , type the corresponding number or continue . so they type 'a'

Ja .
now they type
jav --> 1--java , type corresponding number or continue ..... so they type 1 .

now we have
Java . and so on it goes .
now u got my point ?
what should be my text file look like for the line.... Java is the best .
Nov 9 '06 #4

P: 3
I can totally help you out with this, though I need more details. What's the criteria for a word to be predicted Are any words that start with the entered characters listed? Or are there certain qualifications for a word to be suggested?

Am I understanding you right, or do I have it all wrong? Do you understand me?

This is a perfect place to implement a trie! I've never tried one before so this is exciting.
Nov 9 '06 #5

P: 27
Hi there, mate the program says that when a user types a letter then he should be given an option of some words .
check my example .
in the txt file there can be as many words as u want to be but for the above problem only one sentence will do .
check my example above mate
My head gonna burst now ! i really need some good help buddy .
Nov 9 '06 #6

P: 27
Please Someone Help Me Here ???
Nov 14 '06 #7

Post your reply

Sign in to post your reply or Sign up for a free account.