Package org.apache.stanbol.commons.caslight

Examples of org.apache.stanbol.commons.caslight.FeatureStructure.addFeature()


            for (int i = 0; i < attrs.getLength(); i++) {
                String name = attrs.getQName(i);
                String value = attrs.getValue(i);
                if (checkIfInteger(value)) {
                    Feature<Integer> f = new Feature(name, value);
                    fs.addFeature(f);
                } else {
                    Feature<String> f = new Feature(name, value);
                    fs.addFeature(f);
                }
            }
View Full Code Here


                if (checkIfInteger(value)) {
                    Feature<Integer> f = new Feature(name, value);
                    fs.addFeature(f);
                } else {
                    Feature<String> f = new Feature(name, value);
                    fs.addFeature(f);
                }
            }
            fsList.add(fs);

        }
View Full Code Here

                }
                if (casF.getRange().isPrimitive()) {
                    logger.debug("Getting primitive value...");
                    if (casF.getRange().getName().equals("uima.cas.String")) {
                        String fVal = casFs.getStringValue(casF);
                        newFs.addFeature(new Feature<String>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Integer")) {
                        int fVal = casFs.getIntValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Short")) {
                        short fVal = casFs.getShortValue(casF);
View Full Code Here

                    if (casF.getRange().getName().equals("uima.cas.String")) {
                        String fVal = casFs.getStringValue(casF);
                        newFs.addFeature(new Feature<String>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Integer")) {
                        int fVal = casFs.getIntValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Short")) {
                        short fVal = casFs.getShortValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, (int) fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Byte")) {
                        byte fVal = casFs.getByteValue(casF);
View Full Code Here

                    } else if (casF.getRange().getName().equals("uima.cas.Integer")) {
                        int fVal = casFs.getIntValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Short")) {
                        short fVal = casFs.getShortValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, (int) fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Byte")) {
                        byte fVal = casFs.getByteValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, (int) fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Double")) {
                        double fVal = casFs.getDoubleValue(casF);
View Full Code Here

                    } else if (casF.getRange().getName().equals("uima.cas.Short")) {
                        short fVal = casFs.getShortValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, (int) fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Byte")) {
                        byte fVal = casFs.getByteValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, (int) fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Double")) {
                        double fVal = casFs.getDoubleValue(casF);
                        newFs.addFeature(new Feature<Double>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Float")) {
                        float fVal = casFs.getFloatValue(casF);
View Full Code Here

                    } else if (casF.getRange().getName().equals("uima.cas.Byte")) {
                        byte fVal = casFs.getByteValue(casF);
                        newFs.addFeature(new Feature<Integer>(fName, (int) fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Double")) {
                        double fVal = casFs.getDoubleValue(casF);
                        newFs.addFeature(new Feature<Double>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Float")) {
                        float fVal = casFs.getFloatValue(casF);
                        newFs.addFeature(new Feature<Double>(fName, (double) fVal));
                    } else {
                        Object fVal = casFs.clone();
View Full Code Here

                    } else if (casF.getRange().getName().equals("uima.cas.Double")) {
                        double fVal = casFs.getDoubleValue(casF);
                        newFs.addFeature(new Feature<Double>(fName, fVal));
                    } else if (casF.getRange().getName().equals("uima.cas.Float")) {
                        float fVal = casFs.getFloatValue(casF);
                        newFs.addFeature(new Feature<Double>(fName, (double) fVal));
                    } else {
                        Object fVal = casFs.clone();
                        newFs.addFeature(new Feature<Object>(fName, fVal));
                    }
View Full Code Here

                    } else if (casF.getRange().getName().equals("uima.cas.Float")) {
                        float fVal = casFs.getFloatValue(casF);
                        newFs.addFeature(new Feature<Double>(fName, (double) fVal));
                    } else {
                        Object fVal = casFs.clone();
                        newFs.addFeature(new Feature<Object>(fName, fVal));
                    }

                } else {
                    logger.debug("Getting FeatureStructure value...");
                    throw new UnsupportedOperationException("This client cannot handle FeatureStructure features");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.