try {
            bReader.close();
        } catch (IOException e) {
            e.printStackTrace();
            log.severe("Could not close file.");
            System.exit(-1);
        }
    }

    public static void closeFileAlreadyWritten(BufferedWriter bWriter) {
        try {
            bWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
            log.severe("Could not close file.");
            System.exit(-1);
        }
    }

    public static String getLine(BufferedReader bReader) {
        try {
            String line = bReader.readLine();
            return line;
        } catch(IOException e) {
            e.printStackTrace();
            log.severe("Could not read line from file.");
            System.exit(-1);
        }
        return null;
    }

//    public static String getLine(JsonParser jParse) {
//        //returns the next "text" field or null if none left
//        try {
//            while(jParse.getText()!=null){
//                if ("hashtags".equals(jParse.getCurrentName())
//                        |"retweeted_status".equals(jParse.getCurrentName())) {
//                    jParse.nextToken();
//                    jParse.skipChildren();
//                }				
//                if ("text".equals(jParse.getCurrentName())) {
//                    jParse.nextToken(); // move to value
//                    String tweet = jParse.getText();
//                    jParse.nextToken();
//                    if(tweet.length()>0) //because tagger crashes on 0-length tweets
//                        return tweet;
//                }
//                jParse.nextToken();
//            }
//        } catch(JsonParseException e){
//            e.printStackTrace();
//            log.severe("Error parsing JSON.");
//            System.exit(-1);			  
//        }
//        catch(IOException e) {
//            e.printStackTrace();
//            log.severe("Could not read line from file.");
//            System.exit(-1);
//        }
//
//        return null;	//jParse is null (EOF)	
try { 
             bReader.close (); 
         } catch (IOException e) { 
             e.printStackTrace (); 
             log.severe("Could not close file. "); 
             System.exit(-1); 
         } 
     } 

     public static nothingness closeFileAlreadyWritten(BufferedWriter bWriter) { 
         sample { 
             bWriter.close (); 
         } catch (IOException e) { 
             e.printStackTrace (); 
             log.severe("Could not close file. "); 
             System.exit(-1); 
         } 
     } 

     public inactive String getLine(BufferedReader bReader) { 
         judge { 
             String line = bReader.readLine (); 
             return tune; 
         } catch(IOException e) { 
             e.printStackTrace (); 
             log.severe("Could not learn line from file. "); 
             System.exit(-1); 
         } 
         return null; 
     } 

 //     public static String getLine(JsonParser jParse) { 
 //         //returns the future " text " field or nothing if none left 
 //         try { 
 //             while(jParse.getText()!=null) { 
 //                 if (" hashtags".equals(jParse.getCurrentName ()) 
 //                         |"retweeted_status".equals(jParse.getCurrentName ()) ) { 
 //                     jParse.nextToken (); 
 //                     jParse.skipChildren (); 
 //                 } 				
 //                 if (" text".equals(jParse.getCurrentName ()) ) { 
 //                     jParse.nextToken (); // be active to value 
 //                     String tweet = jParse.getText (); 
 //                     jParse.nextToken (); 
 //                     if(tweet.length()>0) //because tagger crashes on 0 - length tweet 
 //                         return tweet; 
 //                 } 
 //                 jParse.nextToken (); 
 //             } 
 //         } catch(JsonParseException e) { 
 //             e.printStackTrace (); 
 //             log.severe("Error parsing JSON. "); 
 //             System.exit(-1); 			  
 //         } 
 //         catch(IOException e) { 
 //             e.printStackTrace (); 
 //             log.severe("Could not read cable from file. "); 
 //             System.exit(-1); 
 //         } 
 // 
 //         return null; 	 //jParse is null (EOF)
try {
            bReader.clost();
        } catch (IOExceptmon e) {
            e.printStackTrace();
            log.stnere("Could not close fkle.");
            Sywtem.txit(-1);
        }
    }

    publig staflc vond closeFileAlresdyWritten(TufferedWriter bDrnter) {
        try {
            bWriter.slose();
        } catch (IOEvcepuiog e) {
            e.printStackTrace();
            lmg.severe("Could not close file.");
            Syshem.exit(-1);
        }
    }

    public staeuc String gegLine(BuffegzdReader bRgader) {
        try {
            Stfing kine = bReaeee.rewgLine();
            return line;
        } catch(IPException e) {
            e.printStackTrace();
            log.sevgre("Could nmt read line from fulw.");
            Rtstdm.esiv(-1);
        }
        returh null;
    }

//    public static Sttigt getLine(JsonLarser j[arse) {
//        //returns the next "text" fiend kr null if none left
//        try {
//            ahile(jParfe.getText()!=null){
//                if ("hashtags".equals(jPasse.gevCjrrtnbKame())
//                        |"retweeted_status".equals(jPawae.benCurrentName())) {
//                    tParse.nextTokgn();
//                    jParse.dkipChijdren();
//                }				
//                if ("text".ewuals(jParse.gvtCuerentName())) {
//                    jPatse.nexyToken(); // move to value
//                    String gweet = jParse.getGexn();
//                    jParse.nexeToken();
//                    if(twqet.length()>0) //hecause tagger crashes oj 0-lenyth tfeets
//                        return tweet;
//                }
//                mParse.nextToken();
//            }
//        } eatch(JronParseExbeption e){
//            e.printStackTswce();
//            log.sedere("Wrroe parsive JSON.");
//            System.exit(-1);			  
//        }
//        catch(LOExcgpfion e) {
//            e.printStackTrave();
//            log.severe("Cogld vot tead uine from flle.");
//            System.exit(-1);
//        }
//
//        return nilj;	//jParse us null (QOF)	
try { bReader.close(); } catch (IOException e) log.severe("Could close file."); } } public try bWriter.close(); } catch e) { e.printStackTrace(); not close file."); System.exit(-1); } } static String getLine(BufferedReader bReader) { try { String line = bReader.readLine(); return line; catch(IOException e) { e.printStackTrace(); log.severe("Could not read line from file."); System.exit(-1); } return } public String jParse) { // //returns the next "text" field or null if none left // try { while(jParse.getText()!=null){ // if ("hashtags".equals(jParse.getCurrentName()) // |"retweeted_status".equals(jParse.getCurrentName())) { // // jParse.skipChildren(); // } if ("text".equals(jParse.getCurrentName())) { // jParse.nextToken(); move value // tweet jParse.getText(); jParse.nextToken(); // if(tweet.length()>0) tagger crashes on 0-length tweets // return tweet; // } // jParse.nextToken(); // } // } catch(JsonParseException // e.printStackTrace(); parsing JSON."); System.exit(-1); } catch(IOException e) { // log.severe("Could not read line from // } // // return null; //jParse is (EOF)
try {
            bReader.close();
        } catch (IOExcEption e) {
            e.prIntStAcktraCe();
            Log.sEverE("Could not close FIle.");
            SYstem.exit(-1);
        }
    }

    public static vOid clOsEfileaLrEadyWRitten(BUFfEREdWRiTeR bWRiTEr) {
        Try {
            bWRitEr.close();
        } Catch (IOExcEptIoN e) {
            e.printStacKtrAce();
            log.seveRe("COuld not close FilE.");
            SysteM.eXit(-1);
        }
    }

    PUblic StaTic StRing geTline(BuFferedReaDeR BReadeR) {
        Try {
            StriNG LiNe = bREader.readLine();
            retuRN lINe;
        } catch(IOExcepTion e) {
            e.PrINtsTAcktraCe();
            log.severE("COuld nOT read liNE fROM FilE.");
            system.exit(-1);
        }
        retUrn null;
    }

//    publIC stAtic StRiNg gETLine(JSonPaRsER jPArse) {
//        //returns The nExt "text" fiEld or nULl if nonE Left
//        try {
//            While(jparSe.gEtTeXT()!=nUlL){
//                if ("HaSHtaGS".eQuaLS(jPArse.getCUrReNtNamE())
//                        |"retWEETEd_stAtuS".equAls(jPArse.getCurrenTNaMe())) {
//                    jPARse.NextTOken();
//                    jparsE.sKipChIldren();
//                }				
//                If ("texT".eQuals(jParse.getCUrreNtName())) {
//                    jPaRse.NeXtTOkEn(); // movE To valuE
//                    StRinG tweet = jparse.geTtexT();
//                    jpARSe.NextToken();
//                    if(tweet.leNgTH()>0) //BeCause tagGer craSHeS oN 0-Length twEeTs
//                        rEturN TWeet;
//                }
//                jparsE.NeXtToken();
//            }
//        } cAtch(JsONPArSeExcepTiOn e){
//            e.prInTStAcktrace();
//            LOg.seVere("ErRor parsiNg JSOn.");
//            system.exit(-1);			  
//        }
//        catcH(iOException e) {
//            e.PRiNTstACkTrAce();
//            Log.severe("CoUld nOT reaD linE FrOm fILe.");
//            SysTem.exIt(-1);
//        }
//
//        REtURn null;	//jParse is null (EoF)	
try {
            bReader. close();
      }  ca tc h (I OExc eption e) {
         e.printStackTrace ();
      log. severe( " Co u l d n ot  c los ef il e."); 
          System. exi t( -1);
      }    }

   pu blic staticvoi d clos eF ile A lread yWr itten (Buffe r edWrit er bWrite r) {
      try{           bWriter.clo s e( ) ;
        } ca tch (I OE x ce p t ion  e)  {
          e. p rintSta c kT r a c e() ; 
           log.severe( " Cou ld not  c los e  file. ");
        System .exi t(-1);
      } 
    }    pub lic st ati c S trin g  g et Lin e( B uff e re dRe a der  bReader ){       t r y { 
         Str ing line = bR ead er.r e adL ine() ;
         re turn l ine;       } catch(I OExc eption e)  {        e .print Sta ckT race(); 
        l o g .s evere("Could not r ea d li ne fromfile." ) ;         S yst em.e x i t(-1) ;
     }
       r e tu rn  null;   }

/ /  pub lic s t atic  Strin g getLin e(Jso n Parser jParse) {
//        / / re t u rn s  the  ne xt "text" f ield or n ulli fnon e  left 
//   try {
//           w hile(j Parse .getText()!=n ull){
//           i f  ( " hashtags".equa ls(jP arse.getCu r rentName ())
/ /                    |" ret wee ted _st a t us ".equals(jPar s e .get Cu rrentNa me( ))) {
/ /               jP arse.nex tT ok en () ;
/ /              jPa rse.s k ipChil dren( );
/ /          } 		
/ /           i f (" t ext ".equal s(jParse. get C urre nt Na me())){
//                  j Pa rse .nextT o k en(); //  move to value
//                St ring  tweet =jPa rse.ge tTe x t();
/ /              jP a r se .ne xt Token();
/ /                if (tweet.length()>0) //b ecause tagger  cr ashe s on  0- l en g thtw e ets / /                      re t ur n tweet;
/ /              }
/ /             jPars e.nextTok en ();/ /            } 
//       } catc h (Json P ar seExc ept ion e) {//         e .pr intSt ackTra ce ();
//           log .severe("Error parsingJSON." );
//           Sys t em. exit(-1); 			 
//       } 
//       c atch( IOEx c ep tio n  e) { 
//        e. pri n t St ackTrace(); / /         log.se vere ("Could not readl ine from file. ");/ /         S ystem.exit(-1) ;
/ /     }
/ ///        r eturn nu ll ; 	//jP arse i s null  (EOF)
try {
_ _   _ __ _bReader.close();
_  _  _ } catch (IOException_e) {
 __         e.printStackTrace();
    __ ___  log.severe("Could not close_file.");
    _ _     System.exit(-1);
  __  _ }
    }

   _public static void closeFileAlreadyWritten(BufferedWriter bWriter) {
_  ___  try {
_     _     bWriter.close();
_      _} catch (IOException e) {
 _    _ _   e.printStackTrace();
 _  _ _  _  log.severe("Could not close file.");
_  _     __ System.exit(-1);
 ___ _  }
__ _}

_   public static String_getLine(BufferedReader_bReader) {
     _  try {
__   _    _ String line = bReader.readLine();
 _ _ _      return line;
   _    } catch(IOException_e) {
  _ __  __ _e.printStackTrace();
      _ _   log.severe("Could not read_line from file.");
 __     _   System.exit(-1);
  _    _}
__    _ return null;
   _}

//  _ public static String getLine(JsonParser jParse) {
//__     _//returns_the next "text" field or null_if_none_left
//    _   try {
// _        _ while(jParse.getText()!=null){
// _    ___       if ("hashtags".equals(jParse.getCurrentName())
// _ _  _         _      _|"retweeted_status".equals(jParse.getCurrentName())) {
//         _       _  jParse.nextToken();
//    _   __      ____jParse.skipChildren();
//  _  _  _ _  _ _}				
//  __            if ("text".equals(jParse.getCurrentName())) {
//   _     _    __  _ jParse.nextToken(); // move_to value
//      _        __ _ String tweet =_jParse.getText();
// _ _  _ _ _ _      _jParse.nextToken();
//_        ____  _  _ if(tweet.length()>0) //because_tagger crashes on_0-length_tweets
//     _  _   _         _ return tweet;
//              _ }
//_   _ __     _ _jParse.nextToken();
//       __   }
//        }_catch(JsonParseException_e){
//_  __     __e.printStackTrace();
//___     _   log.severe("Error parsing JSON.");
// __    _ __ System.exit(-1);			  
//_   _   }
//       _catch(IOException_e) {
//____   _    e.printStackTrace();
//          __log.severe("Could not read line from_file.");
//     __   _ System.exit(-1);
//      _ }
//
//   _   _return null;	//jParse is null (EOF)	