Examples of TreeWordList


Examples of org.apache.uima.ruta.resource.TreeWordList

      if (resource.exists()) {
        try {
          if (list.endsWith("mtwl")) {
            wordLists.put(list, new MultiTreeWordList(resource));
          } else {
            wordLists.put(list, new TreeWordList(resource));
          }
        } catch (IOException e) {
          Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
                  "Error reading word list" + list, e);
        }
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

      if (resource.exists()) {
        try {
          if (list.endsWith("mtwl")) {
            wordLists.put(list, new MultiTreeWordList(resource));
          } else {
            wordLists.put(list, new TreeWordList(resource));
          }
        } catch (IOException e) {
          Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
                  "Error reading word list" + list, e);
        }
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

      }
      monitor.beginTask("Converting files...", files.size());
      for (IFile file : files) {
        monitor.setTaskName("Compiling " + file.getLocation().lastSegment() + "...");
        String path = file.getRawLocation().toString();
        TreeWordList list;
        try {
          list = new TreeWordList(path);
        } catch (IOException e) {
          RutaAddonsPlugin.error(e);
          return Status.CANCEL_STATUS;
        }
        String exportPath = path.substring(0, path.length() - 3) + "twl";
        list.createXMLFile(exportPath, "UTF-8");
        IWorkspaceRoot myWorkspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
        IContainer container = myWorkspaceRoot.getContainerForLocation(file.getLocation());
        if (container != null) {
          try {
            container.getParent().refreshLocal(1, null);
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

      RutaWordList wl = null;
      RutaBlock parent = element.getParent();
      if (list != null) {
        wl = list.getList(parent);
      } else if (stringList != null) {
        wl = new TreeWordList(stringList.getList(parent, stream));
      }
      if (wl instanceof TreeWordList) {
        Collection<AnnotationFS> found = wl.find(windowStream,
                ignore.getBooleanValue(parent, match, element, stream),
                ignoreLength.getIntegerValue(parent, match, element, stream), null, 0,
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

      RutaStream windowStream = stream.getWindowStream(annotationFS, annotationFS.getType());
      RutaWordList wl = null;
      if (list != null) {
        wl = list.getList(element.getParent());
      } else if (stringList != null) {
        wl = new TreeWordList(stringList.getList(element.getParent()));
      }
      if (wl instanceof TreeWordList) {
        Collection<AnnotationFS> found = wl.find(windowStream,
                ignore.getBooleanValue(element.getParent()),
                ignoreLength.getIntegerValue(element.getParent()), null, 0,
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

      }
      monitor.beginTask("Converting files...", files.size());
      for (IFile file : files) {
        monitor.setTaskName("Compiling " + file.getLocation().lastSegment() + "...");
        String path = file.getRawLocation().toString();
        TreeWordList list;
        try {
          list = new TreeWordList(path);
        } catch (IOException e) {
          RutaAddonsPlugin.error(e);
          return Status.CANCEL_STATUS;
        }
        String exportPath = path.substring(0, path.length() - 3) + "twl";
        list.createXMLFile(exportPath, "UTF-8");
        IWorkspaceRoot myWorkspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
        IContainer container = myWorkspaceRoot.getContainerForLocation(file.getLocation());
        try {
          container.getParent().refreshLocal(1, null);
        } catch (CoreException e) {
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

          found = true;
          try {
            if (file.getName().endsWith("mtwl")) {
              wordLists.put(list, new MultiTreeWordList(file.getAbsolutePath()));
            } else {
              wordLists.put(list, new TreeWordList(file.getAbsolutePath()));
            }
          } catch (IOException e) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
                    "Error reading word list", e);
            found = false;
          }
          break;
        }
      }
      if (!found) {
        InputStream stream = ClassLoader.getSystemResourceAsStream(list);
        if (stream != null) {
          found = true;
          try {
            if (list.endsWith(".mtwl"))
              wordLists.put(list, new MultiTreeWordList(stream, list));
            else
              wordLists.put(list, new TreeWordList(stream, list));
          } catch (IOException e) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
                    "Error reading word list from classpath", e);
            found = false;
          }
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

      if (resource.exists()) {
        try {
          if (list.endsWith("mtwl")) {
            wordLists.put(list, new MultiTreeWordList(resource));
          } else {
            wordLists.put(list, new TreeWordList(resource));
          }
        } catch (IOException e) {
          Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
                  "Error reading word list" + list, e);
        }
View Full Code Here

Examples of org.apache.uima.ruta.resource.TreeWordList

      RutaWordList wl = null;
      RutaBlock parent = element.getParent();
      if (list != null) {
        wl = list.getList(parent);
      } else if (stringList != null) {
        wl = new TreeWordList(stringList.getList(parent, stream));
      }
      if (wl instanceof TreeWordList) {
        Collection<AnnotationFS> found = wl.find(windowStream,
                ignore.getBooleanValue(parent, match, element, stream),
                ignoreLength.getIntegerValue(parent, match, element, stream), null, 0,
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.