Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21
    Sultarazi is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: Calculate similarity

    this is the code :

    Java Code:
     public static void main(String[] args) throws Exception {
    
           ArrayList<String> fileData = new ArrayList<String>();
                    try{
                            
                            BufferedReader fileReader = new BufferedReader(new FileReader("/Users/salateno/Desktop/test.txt"));
                            String line = "";
                             
                            while ( (line = fileReader.readLine()) != null) {
                                    fileData.add(line);
                                    System.out.println("" + line.split("\t"));
                            }
                    }catch (Exception e) {
                            System.out.println("Error");
                            e.printStackTrace();
                    }
            }
    }


    this is the result...sorry it gave me java.lang.String not "nullPointer":

    Java Code:
    run:
    [Ljava.lang.String;@70329f3d
    [Ljava.lang.String;@b749757
    [Ljava.lang.String;@137bd6a1
    [Ljava.lang.String;@2747ee05
    [Ljava.lang.String;@635b9e68
    [Ljava.lang.String;@13fcf0ce
    [Ljava.lang.String;@43256ea2
    [Ljava.lang.String;@4e82701e
    [Ljava.lang.String;@558ee9d6
    [Ljava.lang.String;@199a0c7c
    [Ljava.lang.String;@50a9ae05
    [Ljava.lang.String;@33dff3a2
    [Ljava.lang.String;@33f42b49
    [Ljava.lang.String;@6345e044
    [Ljava.lang.String;@86c347
    [Ljava.lang.String;@f7e6a96
    [Ljava.lang.String;@3487a5cc
    [Ljava.lang.String;@35960f05
    [Ljava.lang.String;@eb42cbf
    [Ljava.lang.String;@56e5b723
    [Ljava.lang.String;@35a8767
    [Ljava.lang.String;@2c6f7ce9
    [Ljava.lang.String;@4b71bbc9
    [Ljava.lang.String;@17dfafd1
    [Ljava.lang.String;@5e8fce95
    [Ljava.lang.String;@3343c8b3
    [Ljava.lang.String;@272d7a10
    [Ljava.lang.String;@1aa8c488
    [Ljava.lang.String;@3dfeca64
    [Ljava.lang.String;@22998b08
    [Ljava.lang.String;@e76cbf7
    [Ljava.lang.String;@1948cc8c
    [Ljava.lang.String;@7a6d084b
    [Ljava.lang.String;@c3bb2b8
    [Ljava.lang.String;@2352544e
    [Ljava.lang.String;@721cdeff
    [Ljava.lang.String;@457471e0
    [Ljava.lang.String;@5fe04cbf
    [Ljava.lang.String;@7ecec0c5
    [Ljava.lang.String;@37d2068d
    [Ljava.lang.String;@3dac2f9c
    [Ljava.lang.String;@7369ca65
    [Ljava.lang.String;@2666e815
    BUILD SUCCESSFUL (total time: 1 second)

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: Calculate similarity

    The print out you got is for a String array's toString method, the default output for arrays. If you want to see the contents of an array, use the Arrays toString() method to format the array for printing:
    System.out.println(Arrays.toString( line.split("\t")));

  3. #23
    Sultarazi is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: Calculate similarity

    Java Code:
    [ID, Command , Target, Value]
    [e1, Open, /magento/index.php/]
    [e2, clickAndWait, link=Log In]
    [e3, Type, Email, abc@xyz.com]
    [e4, Type, Pass, Mypswd1]
    [e5, clickAndWait,  send2]
    [e6, clickAndWait, //img[@alt='Magento Commerce']]
    [e7, clickAndWait, link=Acer Ferrari 3200 Notebook Computer PC]
    [e8, Type,  Qty, 1]
    [e9, clickAndWait, //button[@onclick='productAddToCartForm.submit()']]
    [e10, clickAndWait, //img[contains(@src ,'http://www.example.com/magento/skin/frontend/default/default/images/btn_trash.gif')]]
    [e11, clickAndWait,  link=Log Out]
    [e12, Open, /magento/index.php/]
    [e13, clickAndWait,  link=Log In]
    [e14, Type,  Email, bcd@xyz.com]
    [e15, Type,  Pass, Mypswd2]
    [e16, clickAndWait,  send2]
    [e17, clickAndWait, //img[@alt='Magento Commerce']]
    [e18, clickAndWait, link=Olympus Stylus 750 7.1MP Digital Camera]
    [e19, Type, Qty, 2]
    [e20, clickAndWait, /button[@onclick='productAddToCartForm.submit()']]
    [e21, clickAndWait, //img[@alt='Proceed to Checkout']]
    [e22, Type, billing:firstname, First]
    [e23, Type, billing:lastname, Last]
    [e24, Type, billing:street1, Address]
    [e25, Type, billing:city, City]
    [e26, Select, billing:region_id, label=statename]
    [e27, Type, billing:postcode, 11111]
    [e28, Type, billing:telephone, 8141234567]
    [e29, clickAndWait, billing:use_for_shipping_yes]
    [e30, clickAndWait, //button[@onclick='billing.save()']]
    [e31, clickAndWait, s_method_flatrate_flatrate]
    [e32, clickAndWait, //button[@onclick='shippingMethod.save()']]
    [e33, clickAndWait, p_method_checkmo]
    [e34, clickAndWait, //button[@onclick='payment.save()']]
    [e35, clickAndWait, //input[@value='Place Order']]
    [e36, clickAndWait, link=Log Out]
    [e37, Open, /magento/index.php/]
    [e38, clickAndWait, link=Log In]
    [e39, Type, Email, cde@xyz.com]
    [e40, Type, Pass, Mypswd3]
    [e41, clickAndWait,  send2]
    [e42, clickAndWait,  link=Log Out]
    is this a tab between each element ?!?!?!?!

  4. #24
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: Calculate similarity

    is this a tab between each element ?!?!?!?!
    Not sure what you are asking. The Arrays toString method places a comma (,) between each element in the array.

  5. #25
    Sultarazi is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: Calculate similarity

    I want only tab between each element .. I want to avoid the comma between each element ... I mean I print the file after you provide me that print statement for Array.toString....it gave me the result that I post it in the previous threat.

  6. #26
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default Re: Calculate similarity

    The Arrays toString method is for debugging to show you what is in an array.
    If you want a different output you will have to write it yourself.

  7. #27
    Sultarazi is offline Member
    Join Date
    Feb 2012
    Posts
    14
    Rep Power
    0

    Default Re: Calculate similarity

    ok I will write it and I will show you what I got

Page 2 of 2 FirstFirst 12

Similar Threads

  1. find perceptual similarity between two images
    By soheilz92 in forum Advanced Java
    Replies: 2
    Last Post: 09-13-2011, 11:14 PM
  2. cosine similarity in search engine
    By panny in forum New To Java
    Replies: 4
    Last Post: 03-21-2011, 03:03 PM
  3. Replies: 0
    Last Post: 03-01-2011, 01:48 PM
  4. is Cosine Similarity the Default Similarity in Lucene?
    By sethu.iit@gmail.com in forum Lucene
    Replies: 0
    Last Post: 06-30-2010, 10:49 AM
  5. Similarity
    By John Atsh in forum Lucene
    Replies: 0
    Last Post: 03-23-2009, 02:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •