|
[HepData-svn] r1889 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formatsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Sep 7 15:17:27 BST 2015
Author: whalley Date: Mon Sep 7 15:17:27 2015 New Revision: 1889 Log: change type to name in the qualifiers for SYS Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java Thu Aug 27 12:04:13 2015 (r1888) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java Mon Sep 7 15:17:27 2015 (r1889) @@ -233,6 +233,15 @@ else {s.append(", ");} } } +// if(p.getKeywords().size() > 0) { +// s.append(sp+"{name: keywords, values: ["); +// int np=0; +// for (String pkey : p.getKeywords()){ +// s.append("'"+pkey+"'"); +// if(++np==p.getKeywords().size()){s.append("]}\n"); } +// else {s.append(", ");} +// } +// } Double ecmlow=99999.0; @@ -452,12 +461,30 @@ unit=""; String type=comment.substring(0,comment.indexOf(":")-1).trim(); String value=comment.substring(comment.indexOf(":")+1).trim(); +// String type="SYS"; +// String value=comment; +// if(comment.indexOf(":")>-1) { +// type=comment.substring(0,comment.indexOf(":")-1).trim(); +// value=comment.substring(comment.indexOf(":")+1).trim(); +// } if(type.contains(" IN ")){ unit=type.substring(type.indexOf(" IN ")+4).trim(); type=type.substring(0,type.indexOf(" IN ")).trim(); } s.append(s4+sp+"{name: '"+type.replaceAll("'","''")+"'"); - s.append(", value: '"+ value.replaceAll("'","''")+"'"); + s.append(", value: '"+ value.replaceAll("'","''")+"'"); +// if(type.equals("SYS") && value.indexOf("//")>-1){ +// String comments[] = value.replaceAll("////","//").split("//"); +// for( int i=0; i<comments.length; i++) { +// s.append(s4+sp+"{name: '"+type.replaceAll("'","''")+"'"); +// s.append(", value: '"+ comments[i].replaceAll("'","''")+"'"); +// if(i!=comments.length-1) { s.append("}\n"); } +// } +// } +// else { +// s.append(s4+sp+"{name: '"+type.replaceAll("'","''")+"'"); +// s.append(", value: '"+ value.replaceAll("'","''")+"'"); +// } if(!unit.equals("")){ s.append(", units: '"+ unit+"'"); } @@ -466,12 +493,12 @@ for(Uncertainty error : ds.getErrors()){ if(error.getPlus()==0.0){ - s.append(s4+sp+"{type: sys, value: '"+error.getComment()+"'}\n"); + s.append(s4+sp+"{name: 'SYS', value: '"+error.getComment()+"'}\n"); } } for(Uncertainty error : yax.getErrors()){ if(error.getPlus()==0.0){ - s.append(s4+sp+"{type: sys, value: '"+error.getComment()+"'}\n"); + s.append(s4+sp+"{name: 'SYS', value: '"+error.getComment()+"'}\n"); } }
More information about the HepData-svn mailing list |