public static void main(String[] args) throws Exception {
    if (args.length != 2) {
      System.err.println("usage: java TaggerDemo modelFile fileToTag");
      return;
    }
    
    MaxentTagger tagger = new MaxentTagger(args[0]);//Loading the model for the Tagger
    /////////////////////////////////////////////////////////////////////////////////////
    
    
   
    ////////////////////////////////////////////////////
    ArrayList<String> sent = new ArrayList<String>();
    BufferedReader br = new BufferedReader(new FileReader(args[1]));
    String line;
    int l=0;
    while ((line = br.readLine()) != null)  {
    	if(!line.endsWith("."))
    		line=line+".";
    		
    	sent.add(line);
    	//System.out.println("Sentences "+sent.get(l));
    	l++;
    }
    br.close();
    
    File file = new File(args[1]);
    
	// if file doesn't exists, then create it
	if (!file.exists()) {
		file.createNewFile();
	}

	FileWriter fw = new FileWriter(file.getAbsoluteFile());
	BufferedWriter bw = new BufferedWriter(fw);
	for (int w=0;w<sent.size();w++)
	bw.write(sent.get(w).toString()+"\n");
	bw.close();

	System.out.println("Done with writing and adding period.......");
    
    ////////////////////////////////////////////////////////////////////////////////////////
    List<List<HasWord>> sentences = MaxentTagger.tokenizeText(new BufferedReader(new FileReader(args[1])));
    List<String> allMatches = new ArrayList<String>();
    ArrayList<String> alltags = new ArrayList<String>();
    int i=0,nu=0,cnt=0;
//////////////////Using regular expression to extract tags //////////////////////////////
    Pattern pattern = Pattern.compile("(/[A-Z]+|/[,])"); 
										 

    for (List<HasWord> sentence : sentences) {       // Loop to process each sentence
    ArrayList<TaggedWord> tSentence = tagger.tagSentence(sentence);
    //System.out.println(Sentence.listToString(tSentence, false));

    Matcher matcher = pattern.matcher(Sentence.listToString(tSentence, false));
    while (matcher.find())
    {
    	allMatches.add(matcher.group().substring(1, matcher.group().length()));
    	//System.out.println("Matched Regexp : "+matcher.group().substring(1, matcher.group().length()));
    }
    alltags.add(i,allMatches.toString());
    allMatches.clear();
    i++;
    }
    ////////////////////////Calling the sentence splitter function//////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////
    	
    cnt=slength(sentences,tagger,alltags);
    
    
    int[][] grade = new int[cnt][7];
    
    
   	
    
    
    ////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////
    allMatches.clear();
    alltags.clear();
    sentences.clear();
    i=0;
    sentences = MaxentTagger.tokenizeText(new BufferedReader(new FileReader(args[1])));
    
    
//////////////////Using regular expression to extract tags //////////////////////////////
    pattern = Pattern.compile("(/[A-Z]+|/[,])"); 
    for (List<HasWord> sentence : sentences) {       // Loop to process each sentence
    ArrayList<TaggedWord> tSentence = tagger.tagSentence(sentence);
    //System.out.println(Sentence.listToString(tSentence, false));

    Matcher matcher = pattern.matcher(Sentence.listToString(tSentence, false));
    while (matcher.find())
    {
    	allMatches.add(matcher.group().substring(1, matcher.group().length()));
    	//System.out.println("Matched Regexp : "+matcher.group().substring(1, matcher.group().length()));
    }
    alltags.add(i,allMatches.toString());
    allMatches.clear();
    i++;
    }
    //////////////////Declaring score arrays///////////////////////////////////////////////////
    ArrayList<Integer> svers = new ArrayList<Integer>();
    ArrayList<Integer> woers = new ArrayList<Integer>();
    ArrayList<Integer> msvbs = new ArrayList<Integer>();
    ArrayList<Integer> exvbs = new ArrayList<Integer>();
    ArrayList<Integer> vters = new ArrayList<Integer>();
    //////////////////Calling functions from subvb package/////////////////////////////////////
    woers=worder.wordorder(sentences);
    svers=subvberr.sverror(sentences,tagger,alltags);
    msvbs=vberr.missvb(sentences,tagger,alltags);
    exvbs=vberr.extraverb(sentences, tagger, alltags);
    vters=vberr.vterr(sentences,tagger,alltags);
    
    grading(woers,svers,msvbs,exvbs,vters,cnt);
    
    /*for(int d=0;d<svers.size();d++)
    System.out.println("We have SVErr at : "+svers.get(d));
    
    for(int d=0;d<msvbs.size();d++)
    System.out.println("We have MSVErr at : "+msvbs.get(d));
    
    for(int d=0;d<vters.size();d++)
    System.out.println("We have VTErr at : "+vters.get(d));*/
    
   	}