Project

General

Profile

« Previous | Next » 

Revision 43136

Added by Eri Katsari almost 8 years ago

View differences:

Test.java
98 98
    public void testrecods() {
99 99
        String recordId = " id\thttp://lod.openaire.eu/data/result/doajarticles::1ba2cc76a1da1b039aeafb6da70543b9 http://lod.openaire.eu/vocab/resultSubject \"Social Sciences\" .,";
100 100

  
101
      recordId="<http://lod.openaire.eu/data/result/od_______162::3147f9e84fde4d4599a45b10e6b7dffb> <http://purl.org/dc/terms/publisher> \"EDP Sciences\" ";
101
        recordId = "<http://lod.openaire.eu/data/result/od_______162::3147f9e84fde4d4599a45b10e6b7dffb> <http://purl.org/dc/terms/publisher> \"EDP Sciences\" ";
102 102

  
103 103

  
104
		 String regex = "\\s+(?=((\\\\[\\\\\"]|[^\\\\\"])*\"(\\\\[\\\\\"]|[^\\\\\"])*\")*(\\\\[\\\\\"]|[^\\\\\"])*$)";
105
	    //System.out.println(recordId.replaceAll(regex, "\t"));
104
        String regex = "\\s+(?=((\\\\[\\\\\"]|[^\\\\\"])*\"(\\\\[\\\\\"]|[^\\\\\"])*\")*(\\\\[\\\\\"]|[^\\\\\"])*$)";
105
        //System.out.println(recordId.replaceAll(regex, "\t"));
106 106

  
107 107

  
108
        //recordId=recordId.replaceAll(regex, "\t");
109
        recordId = recordId.replaceAll(" +([?:]) +", "\t");
110
        // System.out.println(recordId);
108 111

  
109
	    //recordId=recordId.replaceAll(regex, "\t");
110
	      recordId = recordId.replaceAll(" +([?:]) +", "\t");
111
	   // System.out.println(recordId);
112 112

  
113 113

  
114
	    String output = StringUtils.join(inputParts, "\"");
114
        String[] split = recordId.split("\t");
115
        for (String s : split) {
115 116

  
116
	    System.out.println("uuu" + output);
117
            System.out.println("each");
118
            System.out.println(s);
119
        }
120
    }
117 121

  
122
    @org.junit.Test
123
    public void testType()
118 124

  
125
    {
126
        String id = "<http://dblp.l3s.de/d2r/resource/publications/journals/ijdsn/DanZYY13>";
119 127

  
120
	    String [] split= recordId.split("\t");
121
	    for (String s: split)
122
	    {
128
        String[] s = id.split("/");
123 129

  
124
		    System.out.println("each");
125
		    System.out.println(s);
126
	    }
127
	}
130
        System.out.println(s[5]);
131
    }
128 132

  
129 133

  
130 134
    public void writeToRedis(String key, String value) throws Exception {

Also available in: Unified diff