Package org.apache.any23.extractor.html.HTMLDocument

Examples of org.apache.any23.extractor.html.HTMLDocument.TextField


            builder.append(sarray[i].value());
            if( i < sarrayLengthMin2) {
                builder.append(delimiter);
            }
        }
        return new TextField( builder.toString(), sarray[0].source() ) ;
    }
View Full Code Here


        FieldValue fieldValue = fields.get(fieldName);
        if(fieldValue == null) {
            fieldValue = new FieldValue();
            fields.put(fieldName, fieldValue);
        }
        fieldValue.addValue( new TextField(value, nd.source()) );
    }
View Full Code Here

            split[1] = split0.substring(0, split0Length -1);
            split[0] = swap;
        }
        TextField[] splitFields = new TextField[split.length];
        for(int i = 0; i < split.length; i++) {
            splitFields[i] = new TextField(split[i], nd.source());
        }
        this.fullName = splitFields;
    }
View Full Code Here

    }

    public void setOrganization(TextField nd) {
        final String value = fixWhiteSpace( nd.value() );
        if (value == null) return;
        this.organization = new TextField(value, nd.source());
    }
View Full Code Here

    public TextField getFullName() {
        if (fullName != null) return join(fullName, " ");
        StringBuffer s = new StringBuffer();
        boolean empty = true;
        Node first = null;
        TextField current;
        for (String fieldName : NAME_COMPONENTS) {
            if (!hasField(fieldName)) continue;
            if (!empty) {
                s.append(' ');
            }
            current = getField(fieldName);
            if(first == null) { first = current.source(); }
            s.append( current.value() );
            empty = false;
        }
        if (empty) return null;
        return new TextField( s.toString(), first);
    }
View Full Code Here

    }

    public void setOrganizationUnit(TextField nd) {
        final String value = fixWhiteSpace( nd.value() );
        if (value == null) return;
        this.unit = new TextField(value, nd.source() );
    }
View Full Code Here

                listing, hLISTING.permalink, link
        );
    }

    private void addPrice(Resource listing) {
        TextField price = fragment.getSingularTextField("price");
        conditionallyAddStringProperty(
                price.source(),
                listing, hLISTING.price, price.value()
        );
    }
View Full Code Here

                listing, hLISTING.price, price.value()
        );
    }

    private void addDescription(Resource listing) {
        TextField description = fragment.getSingularTextField("description");
        conditionallyAddStringProperty(
                description.source(),
                listing, hLISTING.description, description.value()
        );
    }
View Full Code Here

                listing, hLISTING.description, description.value()
        );
    }

    private void addSummary(Resource listing) {
        TextField summary = fragment.getSingularTextField("summary");
        conditionallyAddStringProperty(
                summary.source(),
                listing, hLISTING.summary, summary.value()
        );
    }
View Full Code Here

                listing, hLISTING.summary, summary.value()
        );
    }

    private void addDateTimes(Resource listing) {
        TextField listed = fragment.getSingularTextField("dtlisted");
        conditionallyAddStringProperty(
                listed.source(),
                listing, hLISTING.dtlisted, listed.value()
        );
        HTMLDocument.TextField expired = fragment.getSingularTextField("dtexpired");
        conditionallyAddStringProperty(
                expired.source(),
                listing, hLISTING.dtexpired, expired.value()
View Full Code Here

TOP

Related Classes of org.apache.any23.extractor.html.HTMLDocument.TextField

Copyright © 2018 www.massapicom. 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.