@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); if (writePOS && !writeTokens) { throw new ResourceInitializationException(new IllegalArgumentException( "Setting writePOS to 'true' requires writeToken to be 'true' too.")); } try { // Init with an empty iterator teiElementIterator = asList(new Element[0]).iterator(); // Make sure we know about the first element; nextTeiElement(); } catch (CollectionException | IOException e) { throw new ResourceInitializationException(e); } }
/** * Get the base location used by the reader. This location always ends in a / if it is set at * all. If there is no base, an empty string is returned. * * @return the base location used by the reader. */ protected String getBase() { return getBase(getSourceLocation()); }
protected Resource nextFile() { try { Resource res = resourceIterator.next(); progress.setDone(completed); if (logFreq > 0 && completed % logFreq == 0) { getLogger().info(String.format("%s: %s", progress, res.location)); } return res; } finally { completed++; } }
List<String> excludes = getDefaultExcludes(); if (patterns != null) { for (String pattern : patterns) { ListIterator<String> i = includes.listIterator(); while (i.hasNext()) { i.set(locationToUrl(i.next())); i.set(locationToUrl(i.next())); sourceLocation = locationToUrl(sourceLocation); resources = scan(getSourceLocation(), includes, excludes); getLogger().info("Found [" + resources.size() + "] resources to be read");
throws IOException boolean singleLocation = isSingleLocation(); String base = getBase(aBase); getLogger().info("Scanning [" + base + "]"); URI uri = getUri(rBase, false); if (uri != null) { rsBases.add(uri.toString()); + include); nextResource: for (org.springframework.core.io.Resource resource : resourceList) { URI uResource = getUri(resource, true); if (uResource == null) { continue; String rest = sResource.substring(matchBase.length()); if (matcher.match(exclude, rest)) { if (getLogger().isDebugEnabled()) { getLogger().debug("Excluded: " + sResource); if (isSingleLocation()) {
List<String> excludes = getDefaultExcludes(); if (patterns != null) { for (String pattern : patterns) { ListIterator<String> i = includes.listIterator(); while (i.hasNext()) { i.set(locationToUrl(i.next())); i.set(locationToUrl(i.next())); sourceLocation = locationToUrl(sourceLocation); resources = scan(getSourceLocation(), includes, excludes); getLogger().info("Found [" + resources.size() + "] resources to be read");
throws IOException boolean singleLocation = isSingleLocation(); String base = getBase(aBase); getLogger().info("Scanning [" + base + "]"); URI uri = getUri(rBase, false); if (uri != null) { rsBases.add(uri.toString()); + include); nextResource: for (org.springframework.core.io.Resource resource : resourceList) { URI uResource = getUri(resource, true); if (uResource == null) { continue; String rest = sResource.substring(matchBase.length()); if (matcher.match(exclude, rest)) { if (getLogger().isDebugEnabled()) { getLogger().debug("Excluded: " + sResource); if (isSingleLocation()) {
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); if (writePOS && !writeTokens) { throw new ResourceInitializationException(new IllegalArgumentException( "Setting writePOS to 'true' requires writeToken to be 'true' too.")); } try { // Init with an empty iterator teiElementIterator = asList(new Element[0]).iterator(); // Make sure we know about the first element; nextTeiElement(); } catch (CollectionException | IOException e) { throw new ResourceInitializationException(e); } }
/** * Get the base location used by the reader. This location always ends in a / if it is set at * all. If there is no base, an empty string is returned. * * @return the base location used by the reader. */ protected String getBase() { return getBase(getSourceLocation()); }
protected Resource nextFile() { try { Resource res = resourceIterator.next(); progress.setDone(completed); if (logFreq > 0 && completed % logFreq == 0) { getLogger().info(String.format("%s: %s", progress, res.location)); } return res; } finally { completed++; } }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); if (writePOS && !writeTokens) { throw new ResourceInitializationException(new IllegalArgumentException( "Setting writePOS to 'true' requires writeToken to be 'true' too.")); } try { // Init with an empty iterator teiElementIterator = asList(new Element[0]).iterator(); // Make sure we know about the first element; nextTeiElement(); } catch (CollectionException e) { new ResourceInitializationException(e); } catch (IOException e) { new ResourceInitializationException(e); } }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); if (writePOS && !writeTokens) { throw new ResourceInitializationException(new IllegalArgumentException( "Setting writePOS to 'true' requires writeToken to be 'true' too.")); } try { // Init with an empty iterator teiElementIterator = asList(new Element[0]).iterator(); // Make sure we know about the first element; nextTeiElement(); } catch (CollectionException e) { new ResourceInitializationException(e); } catch (IOException e) { new ResourceInitializationException(e); } }
@Override public void initialize(UimaContext aContext) throws ResourceInitializationException { super.initialize(aContext); if (readPOS && !readToken) { throw new ResourceInitializationException(new IllegalArgumentException( "Setting readPOS to 'true' requires writeToken to be 'true' too.")); } try { // Init with an empty iterator teiElementIterator = asList(new Element[0]).iterator(); // Make sure we know about the first element; nextTeiElement(); } catch (CollectionException | IOException e) { throw new ResourceInitializationException(e); } posMappingProvider = MappingProviderFactory.createPosMappingProvider(mappingPosLocation, posTagset, getLanguage()); }
while (super.hasNext()) { Resource fileResource = nextFile(); Definition def = reader.readWSDL(fileResource.getResolvedUri().toString(),
throws ResourceInitializationException super.initialize(aContext);