Java Code Examples for net.sf.json.JSONObject#getDouble()
The following examples show how to use
net.sf.json.JSONObject#getDouble() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NERTool.java From Criteria2Query with Apache License 2.0 | 5 votes |
public String nerByDicLookUp(String str){ System.out.println("======nerByDicLookUp====="); String res=str; if(str.trim().toLowerCase().equals("male")||str.trim().toLowerCase().equals("female")||str.trim().toLowerCase().equals("women")||str.trim().toLowerCase().equals("men")||str.trim().toLowerCase().equals("man")||str.trim().toLowerCase().equals("woman")){ res="<"+"Demographic"+">"+str+"</"+"Demographic"+">"; return res; } JSONObject jo=new JSONObject(); jo.accumulate("term", str); String result=HttpUtil.doPost(diclookup, jo.toString()); System.out.println("result="+result); JSONObject bestconcept=JSONObject.fromObject(result); try{ System.out.println("matchScore="+bestconcept.getDouble("matchScore")); if(bestconcept.getDouble("matchScore")>0.75) { JSONObject concept_jo=bestconcept.getJSONObject("concept"); String domain=concept_jo.getString("domainId"); res="<"+domain+">"+str+"</"+domain+">"; } }catch(Exception ex){ } System.out.println("dic_result="+res); return res; }
Example 2
Source File: JsonSecurityRule.java From ipst with Mozilla Public License 2.0 | 5 votes |
public static SecurityRule fromJSON(JSONObject json) { return new JsonSecurityRule( new RuleId(RuleAttributeSet.valueOf(json.getString("algoType")), new SecurityIndexId(json.getString("contingencyId"), SecurityIndexType.fromLabel(json.getString("indexType")))), json.getString("workflowId"), (float) json.getDouble("quality"), json.getInt("treeSize"), (float) json.getDouble("criticality"), json.getJSONObject("tree") ); }