Package org.carrot2.util.attribute

Examples of org.carrot2.util.attribute.BindableDescriptor


        // Further processing only if there are words to process
        clusters = Lists.newArrayList();
        if (context.hasLabels())
        {
            // Term-document matrix building and reduction
            final VectorSpaceModelContext vsmContext = new VectorSpaceModelContext(
                context);
            final ReducedVectorSpaceModelContext reducedVsmContext = new ReducedVectorSpaceModelContext(
                vsmContext);
            LingoProcessingContext lingoContext = new LingoProcessingContext(
                reducedVsmContext);
View Full Code Here


        for (ProcessingComponentDescriptor pcd : componentSuite.getComponents())
        {
            try
            {
                final String id = pcd.getId();
                BindableDescriptor bindableDescriptor = pcd.getBindableDescriptor();
                bindableDescriptors.put(id, bindableDescriptor);
                processingDescriptors.put(id, pcd);
            }
            catch (Exception e)
            {
View Full Code Here

        {
            this.componentDescriptor = descriptor;
            this.attributeSets = descriptor.getAttributeSets();

            // Instantiate the component and get bindable metadata
            BindableDescriptor bindableDescriptor = descriptor.getBindableDescriptor();
            this.attributeDescriptors = Maps.newHashMap(bindableDescriptor.attributeDescriptors);

            // Determine groups (it's easier to do that here than in XSLT)
            final HashSet<String> groupSet = Sets.newHashSet();
            for (AttributeDescriptor attributeDescriptor : attributeDescriptors.values())
View Full Code Here

    private void createEditors(Composite parent)
    {
        /*
         * Create a filtered view of attribute descriptors.
         */
        BindableDescriptor descriptor = this.descriptor.only(
            Predicates.not(new InternalAttributePredicate(false))).only(
            new HasEditorPredicate());
        if (filterPredicate != null)
        {
            descriptor = descriptor.only(filterPredicate);
        }

        /*
         * CARROT-818: Check if there is anything for display.
         */
        if (descriptor.attributeDescriptors.isEmpty())
        {
            createMessage(mainControl, this, "No attributes.");
        }

        /*
         * Group attributes.
         */
        descriptor = descriptor.group(grouping);
       
        /*
         * Create sections for attribute groups.
         */
        for (Object groupKey : descriptor.attributeGroups.keySet())
View Full Code Here

    {
        final PanelName section = PanelName.ATTRIBUTES;
        final Section sec = createSection(parent);
        sec.setText(section.name);

        final BindableDescriptor descriptor = getAlgorithmDescriptor();

        final CScrolledComposite scroller = new CScrolledComposite(sec, SWT.H_SCROLL
            | SWT.V_SCROLL);
        resources.add(scroller);
View Full Code Here

    BindableDescriptor getAlgorithmDescriptor()
    {
        final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();
        final String algorithmID = getSearchResult().getInput().getAlgorithmId();

        BindableDescriptor componentDescriptor = core.getComponentDescriptor(algorithmID);
        if (componentDescriptor == null) {
            throw new RuntimeException("No descriptor for algorithm: " + algorithmID);
        }
        return componentDescriptor.only(Input.class,
            Processing.class).only(Predicates.not(new InternalAttributePredicate(false)));
    }
View Full Code Here

     * Default attribute value set for a given component.
     */
    @SuppressWarnings("unchecked")
    static AttributeValueSet getDefaultAttributeValueSet(String componentId)
    {
        BindableDescriptor desc = WorkbenchCorePlugin.getDefault()
            .getComponentDescriptor(componentId);

        final HashMap<String, Object> defaults = Maps.newHashMap();
        for (Map.Entry<String, AttributeDescriptor> e : desc.flatten().only(Input.class).attributeDescriptors
            .entrySet())
        {
            defaults.put(e.getKey(), e.getValue().defaultValue);
        }
        removeSpecialKeys(defaults);
View Full Code Here

     * from the provided map.
     */
    private static void removeInternalNonConfigurationAttributes(
        Map<String, Object> attrs, String componentId)
    {
        BindableDescriptor desc = WorkbenchCorePlugin.getDefault()
            .getComponentDescriptor(componentId);

        attrs
            .keySet()
            .removeAll(
                desc.flatten().only(new InternalAttributePredicate(false)).attributeDescriptors
                    .keySet());
    }
View Full Code Here

          }
        },
       
        // Using the class loader directly because this time we want to omit the prefix
        new ClassLoaderLocator(core.getResourceLoader().getClassLoader())));
   
    this.controller.init(initAttributes);
    this.idFieldName = core.getSchema().getUniqueKeyField().getName();

    // Make sure the requested Carrot2 clustering algorithm class is available
View Full Code Here

                    .defaultLanguage(LanguageCode.ENGLISH);


                    File resourcesDir = new File(environment.configFile(), "carrot2/resources");

                    ResourceLookup resourceLookup = new ResourceLookup(new DirLocator(resourcesDir));

                    DefaultLexicalDataFactoryDescriptor.attributeBuilder(attributes)
                    .mergeResources(true);
                    LexicalDataLoaderDescriptor.attributeBuilder(attributes)
                    .resourceLookup(resourceLookup);
View Full Code Here

TOP

Related Classes of org.carrot2.util.attribute.BindableDescriptor

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.