Examples of IResourceLocator


Examples of org.carrot2.util.resource.IResourceLocator

    initAttributes.put("solrIndexSchema", core.getSchema());

    // Customize Carrot2's resource lookup to first look for resources
    // using Solr's resource loader. If that fails, try loading from the classpath.
    DefaultLexicalDataFactoryDescriptor.attributeBuilder(initAttributes)
        .resourceLookup(new ResourceLookup(new IResourceLocator() {
          public IResource[] getAll(final String resource) {
            final SolrResourceLoader resourceLoader = core.getResourceLoader();
            final String carrot2ResourcesDir = resourceLoader.getConfigDir()
                + initParams.get(CarrotParams.LEXICAL_RESOURCES_DIR, CARROT_RESOURCES_PREFIX);
            try {
View Full Code Here

Examples of org.carrot2.util.resource.IResourceLocator

        final String resourceLookupKey = AttributeUtils.getKey(
            DefaultLexicalDataFactory.class, "resourceLookup");
        final String reloadResourcesKey = AttributeUtils.getKey(
            DefaultLexicalDataFactory.class, "reloadResources");

        final IResourceLocator classpathLocator = Location.CONTEXT_CLASS_LOADER.locator;

        // Create pooling controller, use tempDir1
        final Controller ctrl1 = ControllerFactory.createPooling();
        final ILexicalData data1;
        {
View Full Code Here

Examples of org.carrot2.util.resource.IResourceLocator

        FileUtils.writeStringToFile(new File(tempDir1, "stopwords.en"), "uniquea");

        final File tempDir2 = createTempDir();
        FileUtils.writeStringToFile(new File(tempDir2, "stopwords.en"), "uniqueb");

        final IResourceLocator classpathLocator = Location.CONTEXT_CLASS_LOADER.locator;

        final String resourceLookupKey = AttributeUtils.getKey(DefaultLexicalDataFactory.class, "resourceLookup");
        final String resourceReloadKey = AttributeUtils.getKey(DefaultLexicalDataFactory.class, "reloadResources");

        // Create pooling controller, use tempDir1
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.