vanguard11
دوشنبه 15 خرداد 1391, 14:46 عصر
با سلام خدمت همه دوستان .
راستش برای درس برنامه سازی پیشرفته به زبان جاوا باید یه پروژه بنویسم که کار تصحیح متن رو انجام بده.به دلیل اینکه تازه ترم دوم هستم زیاد به برنامه سازی پیشرفته آشنا نیستم و بد جوری گیر کردم! حالا خواستم ببینم از دوستان کسی می تونه کمکم کنه؟ خودم تو اینترنت یه برنامشو پیدا کردم ولی چیزی ازش حالیم نشد!!برنامرو این پایین میذارم:
public class SpellChecker { public static void main(String[] args) { SET<String> dictionary = new SET<String>(); // read in dictionary of words In dict = new In(args[0]); while (!dict.isEmpty()) { String word = dict.readString(); dictionary.add(word); } System.out.println("Done reading dictionary"); // read strings from standard input and print out if not in dictionary System.out.println("Enter words, and I'll print out the misspelled ones"); while (!StdIn.isEmpty()) { String word = StdIn.readString(); if (!dictionary.contains(word)) System.out.println(word); } } }حالا اگه شما لطف کنین بگین این برنامه چطور نوشته شده ممنون میشم!
راستش برای درس برنامه سازی پیشرفته به زبان جاوا باید یه پروژه بنویسم که کار تصحیح متن رو انجام بده.به دلیل اینکه تازه ترم دوم هستم زیاد به برنامه سازی پیشرفته آشنا نیستم و بد جوری گیر کردم! حالا خواستم ببینم از دوستان کسی می تونه کمکم کنه؟ خودم تو اینترنت یه برنامشو پیدا کردم ولی چیزی ازش حالیم نشد!!برنامرو این پایین میذارم:
public class SpellChecker { public static void main(String[] args) { SET<String> dictionary = new SET<String>(); // read in dictionary of words In dict = new In(args[0]); while (!dict.isEmpty()) { String word = dict.readString(); dictionary.add(word); } System.out.println("Done reading dictionary"); // read strings from standard input and print out if not in dictionary System.out.println("Enter words, and I'll print out the misspelled ones"); while (!StdIn.isEmpty()) { String word = StdIn.readString(); if (!dictionary.contains(word)) System.out.println(word); } } }حالا اگه شما لطف کنین بگین این برنامه چطور نوشته شده ممنون میشم!