Examples of Mapper


Examples of edu.stanford.nlp.trees.treebank.Mapper

    System.err.println("Reading from: " + path.getPath());
    try {
      BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-8"));
      TokenizerFactory<CoreLabel> tf = ArabicTokenizer.factory();
      tf.setOptions(tokOptions);
      Mapper lexMapper = new DefaultLexicalMapper();
      lexMapper.setup(null, "StripSegMarkersInUTF8", "StripMorphMarkersInUTF8");

      int lineId = 0;
      for(String line; (line = br.readLine()) != null; lineId++) {
        line = line.trim();

        // Tokenize with the tokenizer
        List<CoreLabel> tokenizedLine = tf.getTokenizer(new StringReader(line)).tokenize();
        System.out.println(Sentence.listToString(tokenizedLine));

        // Tokenize with the mapper
        StringBuilder sb = new StringBuilder();
        String[] toks = line.split("\\s+");
        for (String tok : toks) {
          String mappedTok = lexMapper.map(null, tok);
          sb.append(mappedTok).append(" ");
        }
        List<String> mappedToks = Arrays.asList(sb.toString().trim().split("\\s+"));

        // Evaluate the output
View Full Code Here

Examples of fr.norsys.mapper.console.mapping.Mapper

    mapperConfig.getSubConfig().setName(
        "http://norsys.fr/framework-ldap/jndi-configuration.dtd");
    mapperConfig.getSubConfig().setClasse(
        "fr.norsys.mapper.jndi.JNDIXMLConfigurator");

    Mapper mapper = null;
    for (Iterator it = application.getResources().iterator(); it
        .hasNext();) {
      Resource r = (Resource) (it.next());
      String name = r.getName();
      StringBuffer root = new StringBuffer();
      Map inputMap = new Map("input-" + name);
      Map outputMap = new Map("output-" + name);
      if(r.getIdentifiant()!=null && r.getIdentifiant().length()>0){
        root.append(r.getIdentifiant()).append(",");
      }
      root.append(r.getBaseDn());
      if (ConsoleCst.SEARCH_MAPPER_TYPE.equals(r.getType())) {
        mapper = new Search(name, "input-" + name, "output-" + name, r
            .getFilter(), root.toString(), r.getScope(),
            "true", "true", r.getCountLimit());
        mapperConfig.getJndiMapper().getSource().getSearchList().add(mapper);
      } else if (ConsoleCst.ADD_MAPPER_TYPE.equals(r.getType())) {
        mapper = new Add(name, "input-" + name, "output-" + name, root.toString());
        mapperConfig.getJndiMapper().getSource().getAddList().add(mapper);
      } else if (ConsoleCst.DELETE_MAPPER_TYPE.equals(r.getType())) {
        mapper = new Delete(name, "input-" + name, "output-" + name, root.toString());
        mapperConfig.getJndiMapper().getSource().getDeleteList().add(mapper);
      } else if (ConsoleCst.MODIFY_MAPPER_TYPE.equals(r.getType())) {
        mapper = new Modify(name, "input-" + name, "output-" + name, root.toString());
        mapperConfig.getJndiMapper().getSource().getModifyList().add(mapper);
      }
      for (Iterator it2 = r.getAttributes().iterator(); it2
          .hasNext();) {
        Attribute a = (Attribute)it2.next();
        if(a.getRule() != null && !"".equals(a.getRule())) {
          mapper.getRegexps().add(new RegExp(a.getName(),a.getRule(),a.getIgnoreNull()));
        }
        String type = a.getInputOutput();
        if (ConsoleCst.INPUT_ATTRIBUTE_TYPE.equals(type)) {
          inputMap.getAttributes().add(
              new fr.norsys.mapper.console.mapping.Attribute(a
View Full Code Here

Examples of net.gridshield.nexsm.mapper.Mapper

     *
     */
    public void createMap() {
        thisDim = getSize();
        // Creates a new mapper
        _map = new Mapper();
        _map.setDimension(thisDim);
        _map.addMapperListener(new MapperEventHandler(this));
        String uri = getCodeBase().getProtocol() + "://" +
                getCodeBase().getHost() +
                (getCodeBase().getPort() >= 0 ? ":"+getCodeBase().getPort():"");
View Full Code Here

Examples of net.jcores.utils.Mapper

     * @param options
     *
     * @return The mapped elements in a stable order  
     */
    public CoreInt map(final F1Int2Int f, Option... options) {
        final Mapper mapper = new Mapper(int.class, this.t.length) {
            @Override
            public void handle(int i) {
                int[] a = (int[]) this.array.get();
                a[i] = f.f(CoreInt.this.t[i]);
            }
        };

        map(mapper, options);

        return new CoreInt(this.commonCore, (int[]) mapper.getTargetArray());
    }
View Full Code Here

Examples of org.apache.catalina.Mapper

                    ((Lifecycle) realm).start();
                if ((resources != null) && (resources instanceof Lifecycle))
                    ((Lifecycle) resources).start();

                // Start our Mappers, if any
                Mapper mappers[] = findMappers();
                for (int i = 0; i < mappers.length; i++) {
                    if (mappers[i] instanceof Lifecycle)
                        ((Lifecycle) mappers[i]).start();
                }
View Full Code Here

Examples of org.apache.hadoop.hive.contrib.mr.Mapper

/**
* Example Mapper (Identity).
*/
public final class IdentityMapper {
  public static void main(final String[] args) throws Exception {
    new GenericMR().map(System.in, System.out, new Mapper() {
      @Override
      public void map(final String[] record, final Output output) throws Exception {
        output.collect(record);
      }
    });
View Full Code Here

Examples of org.apache.hadoop.mapred.Mapper

   * Chains the <code>map(...)</code> methods of the Mappers in the chain.
   */
  @SuppressWarnings({"unchecked"})
  public void map(Object key, Object value, OutputCollector output,
                  Reporter reporter) throws IOException {
    Mapper mapper = chain.getFirstMap();
    if (mapper != null) {
      mapper.map(key, value, chain.getMapperCollector(0, output, reporter),
                 reporter);
    }
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.Mapper

  @Test
  public void testOutputFormatWithMismatchInOutputClasses() throws IOException {
    @SuppressWarnings({ "rawtypes", "unchecked" })
    final MapDriver<Text, Text, LongWritable, Text> driver = MapDriver
        .newMapDriver(new Mapper());
    driver.withOutputFormat(TextOutputFormat.class, TextInputFormat.class);
    driver.withInput(new Text("a"), new Text("1"));
    driver.withOutput(new LongWritable(), new Text("a\t1"));
    driver.runTest();
  }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.mapper.Mapper

    session = RepositoryUtil.login(repository, "superuser", "superuser");
    List<Class> classes = new ArrayList<Class>();
   
    classes.add(B.class);
    classes.add(A.class);   
    Mapper mapper = new AnnotationMapperImpl(classes);
    ocm = new ObjectContentManagerImpl(session, mapper);

   
 
View Full Code Here

Examples of org.apache.ode.jbi.msgmap.Mapper

            if (odeMex.getOperation() != null) {
                copyMexProperties(odeMex, jbiMex);
                javax.wsdl.Message msgdef = odeMex.getOperation().getInput().getMessage();
                Message odeRequest = odeMex.createMessage(odeMex.getOperation().getInput().getMessage().getQName());
                Mapper mapper = _ode.findMapper(request, odeMex.getOperation());
                if (mapper == null) {
                    String errmsg = "Could not find a mapper for request message for JBI MEX " + jbiMex.getExchangeId()
                            + "; ODE MEX " + odeMex.getMessageExchangeId() + " is failed. ";
                    __log.error(errmsg);
                    throw new MessageTranslationException(errmsg);

                }
                odeMex.setProperty(Mapper.class.getName(), mapper.getClass().getName());
                mapper.toODE(odeRequest, request, msgdef);
                odeMex.invoke(odeRequest);

                // Handle the response if it is immediately available.
                if (odeMex.getStatus() != Status.ASYNC) {
                    __log.debug("ODE MEX " + odeMex + " completed SYNCHRONOUSLY.");
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.