New in this forum --> need help in SML

This is a discussion on New in this forum --> need help in SML within the ml forums in Programming Languages category; Hi I am new in this forum and new to SML as well. I need to write a program that checks target words in a text file against a dictionary of correct spellings. If the target word is in the dictionary, it is output to the screen or to an output file. If the target word is not in the dictionary, a list of 'suggestions' is produced which contains words from the dictionary that closely resemble the target word. This is what i have done so far: open TextIO; fun inputStringList (fname : string) = let val instr = openIn ...

Go Back   Application Development Forum > Programming Languages > ml

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 02-21-2008, 06:52 AM
Junior Member
 
Join Date: Feb 2008
xyoruichix is on a distinguished road
Default New in this forum --> need help in SML

Hi I am new in this forum and new to SML as well.
I need to write a program that checks target words in a text file against a dictionary of correct spellings.
If the target word is in the dictionary, it is output to the screen or to an output file.
If the target word is not in the dictionary, a list of 'suggestions' is produced which contains words from the dictionary that closely resemble the target word.

This is what i have done so far:
open TextIO;

fun inputStringList (fname : string) =
let
val instr = openIn fname
val inputList = String.tokens Char.isSpace (inputLine instr)

val dict = openIn "Dictionary.txt"
val dictList = String.tokens Char.isSpace (inputLine dict)

fun member([], h2::t2) = (output(stdOut,"End of file\n"); flushOut stdOut) |
member(h1::t1, h2::t2) = if (h1 = h2) then (output(stdOut,h1^"\n"); flushOut stdOut) andalso member(t1,t2)
else if (h1 <> h2) then member(h1,t2)

in
member(inputList, dictList)
before closeIn(instr)
before closeIn(dict)
end;

I encountered the error below when compiling what I have written above
stdIn:46.1-47.8 Error: syntax error: deleting IN ID

I would like to know how to correct the error and continue from then on.
Thanks in advance for any suggestions and advice given.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:05 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.