Package seekfeel.dataholders

Examples of seekfeel.dataholders.Review


    addAspectextractor(dpAspExt);
    addAspectextractor(miraAspExt);
    int revsSize = Revs.size();
    ArrayList<featuredSentence> fSentences = new ArrayList<featuredSentence>();

    Review tempReview = new Review();
    for (int index = 0; index < revsSize; index++) {
      tempReview.Review_Body =  Revs.get(index).getDataBody();
      tempReview.formatt();
      ArrayList<String> ExtractedFeatures = getFeatures(tempReview);
      ArrayList<relevanceData> rel = getRelevances(ExtractedFeatures);
      // ///////////////////////////////////////
      CRF_Filter cFilter = new CRF_Filter();
      cFilter.WriteDataToSVMTestFile(rel,
View Full Code Here


    {
        try
        {
            BufferedReader in = new BufferedReader(new FileReader(resFile));
            String str;
            Review r = new Review();
            r.Review_Body = "";
            int start = 1;
            while ((str = in.readLine()) != null)
            {
                if(!(str.equals("<name/>")|| str.equals("<name>")))
                {
                    if(str.matches("<name>" + ".+" + "</name>" ))
                    {
                        String text  = str.substring(6 , str.length() - 7);
                       
                        if(text.equals("Recommended:"))
                        {
                             revs.add(r);
                             while ((str = in.readLine()) != null)
                             {
                                  if(str.startsWith("http"))
                                  {
                                    r = new Review();
                                    r.Review_Body = "";
                                    break;
                                  }
                             }
                             if( str == null)
View Full Code Here

        {
            BufferedReader in = new BufferedReader(new FileReader(resFile));
            String str;
            int count = 0;
            int start = 1;
            Review r = new Review();
            while ((str = in.readLine()) != null)
            {
                if(!(str.equals("<name/>")|| str.equals("<name>")))
                {
                    if(str.matches("<name>" + ".+" + "</name>" ))
                    {

                        String text= str.substring(6 , str.length() - 7);
                        if(count >= 3)
                        {
                           if( start != 1)
                           {
                             revs.add(r);
                           }
                           else
                           {
                                start = 0;
                           }
                           r = new Review();
                           r.Review_Body = text;     
                        }
                        else
                        {
                             r.Review_Body += " " + text;
View Full Code Here


    Review Parse_Review_Data(String Sentence)
    {

     Review Parsed_Review = new Review();
    
   
         if(Sentence.contains("[u]") || Sentence.contains("[U]" ) )
         {
            Parsed_Review.Without_Feature = true;
View Full Code Here

         Reviews_Reader R = new Reviews_Reader();
   ArrayList Revs =  R.Get_Reviews_From_File("\\Nokia 6610.txt")// get all the reviews of a text file and put it in an array of Reviews
         DoublePropagationManager dpMan = new DoublePropagationManager();
         for(int k =0; k < 3/*Revs.size()*/; k++)
         {
            Review r = (Review)Revs.get(k);
           // ArrayList<String> aspects = dpMan.extractAspects(r);
            int x = 0;
         }
    }
View Full Code Here

    public static String Title = "";

    public Review Parse_Review_Data(String Sentence) {

        Review Parsed_Review = new Review();


        if (Sentence.contains("[u]") || Sentence.contains("[U]")) {
            Parsed_Review.Without_Feature = true;
            Sentence = Sentence.replace("[u]", "");
            Sentence = Sentence.replace("[U]", "");
        }
        if (Sentence.contains("[p]") || Sentence.contains("[P]")) {
            Parsed_Review.Without_Pronoun_resolution = true;
            Sentence = Sentence.replace("[p]", "");
            Sentence = Sentence.replace("[P]", "");
        }
        if (Sentence.contains("[s]") || Sentence.contains("[S]")) {
            Parsed_Review.Has_Suggetions = true;
            Sentence = Sentence.replace("[s]", "");
            Sentence = Sentence.replace("[S]", "");
        }
        if (Sentence.contains("[CC]") || Sentence.contains("[cc]")) {
            Parsed_Review.Has_Comparison_With_Different_Brand = true;
            Sentence = Sentence.replace("[CC]", "");
            Sentence = Sentence.replace("[cc]", "");
        }
        if (Sentence.contains("[CS]") || Sentence.contains("[cs]")) {
            Parsed_Review.Has_Comparison_With_Same_Brand = true;
            Sentence = Sentence.replace("[cs]", "");
            Sentence = Sentence.replace("[CS]", "");
        }

        String[] Parts = Sentence.split("##");
        if (Parts.length > 0) {
            if (Parts[0].length() < 1) {
                System.out.println(" Features: " + "None");
            } else {
                String[] Features = Parts[0].split(",");
                for (String Feature : Features) {

                    Parsed_Review.Features.add(Get_Feature(Feature));
                }
            }
        }
        if (Parts.length > 1) {
            Parsed_Review.setDataBody(Parts[1]);
        }
        System.out.println(Sentence);

        Parsed_Review.Review_Title = Title;
View Full Code Here

    }

    private double getPositiveCount(String word, CorpusHolder corpus) {
        ArrayList<DataUnit> positiveExamples = corpus.getPositiveExamples();
        int count = 0;
        Review tempReview;
        for (DataUnit posExample : positiveExamples) {
            tempReview = (Review) posExample;
            count += (tempReview.getDataBody().length() - tempReview.getDataBody().replace(word, "").length()) / word.length();
        }
        return count + 0.0001;
    }
View Full Code Here

    }

    private double getNegativeCount(String word, CorpusHolder corpus) {
        ArrayList<DataUnit> negativeExamples = corpus.getNegativeExamples();
        int count = 0;
        Review tempReview;
        for (DataUnit negExample : negativeExamples) {
            tempReview = (Review) negExample;
            count += (tempReview.getDataBody().length() - tempReview.getDataBody().replaceAll(word, "").length()) / word.length();
        }
        return count + 0.0001;
    }
View Full Code Here

TOP

Related Classes of seekfeel.dataholders.Review

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.