Text_Mining

Is there a problem with  this code that read text file contain text separated with ++++++++++
          while(input.ready() ){
               line = input.readLine();
               legalNode = false; //assume it contains no data
                    if(line.length() != 0){
                         if( line.equals("++++++++++") ){
                              line = input.readLine();
                              if( line.equals("111") ){
                                   spam = true;
                              } else {
                                   spam = false;
                         }else if(line.equals("111") ){
                              spam = true;
                         }else if(line.equals("222") ){
                              spam = false;
                    temp = new dataNode();
                         while(input.ready() ){
                              line = input.readLine();
                              if(line.equals("++++++++++") ) {
                                   break;
                              }else if(line.length() == 0){
                                   break;
                              legalNode = true;//we don't have just an empty line
                              start = 0;
                              for(int i =0;i<line.length();i++){
                                   c = line.charAt(i);
                                   if(c == ' '){//found a break in the words
                                        temp.add(spam, line.substring(start, i ) );
                                        start = i+1;
                                   } else if(i == (line.length() - 1) ){//at the last spot
                                        temp.add(spam, line.substring(start, (i+1) ) );
                              }//end for loop
                         // do some function
          }

musa.swd wrote:
Thanks for nice comments. My code does not contain any error! But I want to
know just yours opinion.
My opinion about what? My opinion is that it's hard to read when it isn't indented. And that makes it hard for me to form any other opinions about it, because I haven't really read it.
But it's your code. If you are satisfied with it (and you say you are) then it's fine.

Similar Messages

Maybe you are looking for

  • Just 'upgraded' to Windows Phone 7, now my contacts can't synch from the PC, and Windows Live has a 500KB limit? Is there a way around this nightmare??

    For years I was happily plugging in my Palm Treo Pro, and having my contacts and calendar synch with my PC, WITHOUT the need for that information to be stored on the cloud, where anyone could get at it. When that died recently, I bought a used Window

  • Plot legend flicker when in RUN mode

     Hi all, i have written a code in LV to acquire data from 12 sensors and display them. In the waveform chart I tried renaming the legend. When I run the vi, the legend name flickers to module name and channel name. I am attaching a snapshot to give y

  • Mp4 imports but looks different in project window

    I imported an mp4 into iMovie's event library just fine;  once I pullled it up into the project window it looks jaggy and pixelated.  Is this a temporary view of it?  Will it look like the original clips once it's exported?  I'd be grateful for insig

  • Facing problem in Auto discovery of host in OEM using IP Scan

    Hi All, I want to discover host by configuring the suto discovery. After that when I am specifying an ip address on to be discovered and submitting the job it gives the following error " Host discovery job failed. Exception: untranslatable exception:

  • Zany Templates

    I'm trying to find some fun templates where I can shoot friends posed correctly against a green screen so that their image will insert into the template in just the right place so I can then merge the two into one photo. Do any of you know if those t