Process the text

@param source the sourcetext
@return the result of text processing
@see TextProcessor#process(CharSequence)
1850
public CharSequence process(CharSequence source) {
        if (source != null && source.length() > 0) {
            String stringSource = source instanceof String ? (String) source : source.toString();

            // Array to cache founded indexes of sequences
            int[] indexes = new int[escape.length];
            Arrays.fill(indexes, -1);

            int length = source.length();
            int offset = 0;
            StringBuilder result = new StringBuilder(length);
            while (offset < length) {
                // Find next escape sequence
                int escPosition = -1;
                int escIndex = -1;
                for (int i = 0; i < escape.length; i++) {
                    int index;
                    if (indexes[i] < offset) {
                        index = stringSource.indexOf(escape[i][0], offset);
                        indexes[i] = index;
                    } else {
                        index = indexes[i];
                    }

                    if (index >= 0 && (index < escPosition || escPosition < 0)) {
                        escPosition = index;
                        escIndex = i;
                    }
                }

                // If escape sequence is found
                if (escPosition >= 0) {
                    // replace chars before escape sequence
                    result.append(stringSource, offset, escPosition);

                    // Replace sequence
                    result.append(escape[escIndex][1]);
                    offset = escPosition + escape[escIndex][0].length();
                } else {
                    // Put other string to result sequence 
                    result.append(stringSource, offset, length);
                    offset = length;
                }
            }
            return result;
        } else {
            return new StringBuilder(0);
        }
    }
775517
def process(self, chars):
        

        while len(chars) > 0:
            self.consume(chars[0])
            chars = chars[1:]
86944
public void process(File input) throws IOException {
        File filtered = getFilteredVersion(input);
        if (filtered == null) {
            // It was not copied.
            getLog().warn("Cannot find the filtered version of " + input.getAbsolutePath() + ", " +
                    "using source file.");
            filtered = input;
        }

        // Actual processing.
        String result = instance.markdownToHtml(FileUtils.readFileToString(filtered));

        FileUtils.write(getOutputFile(input, "html"), result);
    }
1252066
public StringBuffer append(Reader source, StringBuffer buffer) throws IOException
	{
		BufferedReader _bufferedReader = new BufferedReader(source);
		char[] _buffer = new char[getBufferSize()]; // load by chunk of 4 ko
		try
		{
			for (int _countReadChars = 0; _countReadChars >= 0;)
			{
				buffer.append(_buffer, 0, _countReadChars);
				_countReadChars = _bufferedReader.read(_buffer);
			}
		}
		finally
		{
			_bufferedReader.close();
		}
		return buffer;
	}
395234
@Override
    public int read() throws IOException {
        int nextChar = super.read();

        // process the character
        if ( nextChar != -1 ) {
            if ( nextChar == '\n' ) {
                m_line++;
                pushColumn( m_column );
                m_column = 0;
            }
            else if ( nextChar == '\r') {
                int aheadChar = super.read();

                // if the lookahead is not a newline combo, unread it
                if ( aheadChar != '\n' ) {
                    // no need to unread it with line/offset update.
                    unreadImpl( aheadChar, false );
                }

                m_line++;
                pushColumn( m_column );
                m_column = 0;

                // normalize
                nextChar = '\n';
            } else {
                m_column++;
            }
            m_consumed++;
        }

        return nextChar;
    }
1120116
public final static String process(final Reader reader, final Configuration configuration) throws IOException
    {
        final Processor p = new Processor(!(reader instanceof BufferedReader) ? new BufferedReader(reader) : reader,
                configuration);
        return p.process();
    }
467011
public StringBuffer process(StringBuffer source) {
        CharSequence result = process((CharSequence) source);
        if (result instanceof StringBuffer) {
            return (StringBuffer) result;
        } else {
            return new StringBuffer(result);
        }
    }
1369765
public CAS process(String text) {
        CAS cas = retrieve();

        cas.setDocumentText(text);
        try {
            analysisEngine.process(cas);
        } catch (AnalysisEngineProcessException e) {
            if (text != null && !text.isEmpty())
                return process(text);
            throw new RuntimeException(e);
        }

        return cas;


    }
1162838
public void process( FastQueue<AssociatedIndex> matches , int numSource , int numDestination ) {

		if( checkSource ) {
			if( checkDestination ) {
				processSource(matches, numSource, firstPass);
				processDestination(firstPass,numDestination,pruned);
			} else {
				processSource(matches, numSource, pruned);
			}
		} else if( checkDestination ) {
			processDestination(matches,numDestination,pruned);
		} else {
			// well this was pointless, just return the input set
			pruned = matches;
		}
	}
1359663
@GwtIncompatible("ByteSource,CharSource")
  public final ByteSource decodingSource(final CharSource encodedSource) {
    checkNotNull(encodedSource);
    return new ByteSource() {
      @Override
      public InputStream openStream() throws IOException {
        return decodingStream(encodedSource.openStream());
      }
    };
  }
1077928
public CharSequence readSource(JavaFileObject filename) {
        try {
            inputFiles.add(filename);
            return filename.getCharContent(false);
        } catch (IOException e) {
            log.error("error.reading.file", filename, JavacFileManager.getMessage(e));
            return null;
        }
    }
735836
protected void processClass (File source)
    {
        // load up the file and determine it's package and classname
        String name = null;
        try {
            name = GenUtil.readClassName(source);
        } catch (Exception e) {
            System.err.println("Failed to parse " + source + ": " + e.getMessage());
            return;
        }

        System.err.println("Considering " + name + "...");

        try {
            // in order for annotations to work, this task and all the classes it uses must be
            // loaded from the same class loader as the classes on which we are going to
            // introspect; this is non-ideal but unavoidable
            processClass(source, getClass().getClassLoader().loadClass(name));
        } catch (ClassNotFoundException cnfe) {
            System.err.println("Failed to load " + name + ".\nMissing class: " + cnfe.getMessage());
            System.err.println("Be sure to set the 'classpathref' attribute to a classpath\n" +
                               "that contains your projects invocation service classes.");
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
    }
1202515
private String hibcProcess(String source) {

        // HIBC 2.6 allows up to 110 characters, not including the "+" prefix or the check digit
        if (source.length() > 110) {
            throw new OkapiException("Data too long for HIBC LIC");
        }

        source = source.toUpperCase();
        if (!source.matches("[A-Z0-9-\\. \\$/+\\%]+?")) {
            throw new OkapiException("Invalid characters in input");
        }

        int counter = 41;
        for (int i = 0; i < source.length(); i++) {
            counter += positionOf(source.charAt(i), HIBC_CHAR_TABLE);
        }
        counter = counter % 43;

        char checkDigit = HIBC_CHAR_TABLE[counter];

        encodeInfo += "HIBC Check Digit Counter: " + counter + "\n";
        encodeInfo += "HIBC Check Digit: " + checkDigit + "\n";

        return "+" + source + checkDigit;
    }
684866
public String execute(final String pointerStr, final Source source)
    {
        try
        {
            final StringWriter stringWriter = new StringWriter();
            final Serializer serializer = processor.newSerializer(stringWriter);
            serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes");
            executeToDestination(pointerStr, source, serializer);
            return stringWriter.toString();
        }
        catch (final XPointerException e)
        {
            final String message = e.getLocalizedMessage();
            if (xPointerErrorHandler != null)
            {
                xPointerErrorHandler.reportError(message);
            }
            else
            {
                LOG.error(message, e);
            }
        }
        return "";
    }
154994
public void addSource(String source)
    {
        if(this.sources == null)
            this.sources = new ArrayList<String>();
        this.sources.add(source);
    }
1231767
public void process() {
    if (src == null && dest == null) {
      throw new IllegalArgumentException("Source and destination shouldn't be null together");
    }

    File destinationFile = null;
    try {
      destinationFile = getDestinationFile();
      ZipOutputStream out = null;
      ZipEntryOrInfoAdapter zipEntryAdapter = null;

      if (destinationFile.isFile()) {
        out = ZipFileUtil.createZipOutputStream(new BufferedOutputStream(new FileOutputStream(destinationFile)), charset);
        zipEntryAdapter = new ZipEntryOrInfoAdapter(new CopyingCallback(transformers, out, preserveTimestamps), null);
      }
      else { // directory
        zipEntryAdapter = new ZipEntryOrInfoAdapter(new UnpackingCallback(transformers, destinationFile), null);
      }
      try {
        processAllEntries(zipEntryAdapter);
      }
      finally {
        IOUtils.closeQuietly(out);
      }
        handleInPlaceActions(destinationFile);
    }
    catch (IOException e) {
      ZipExceptionUtil.rethrow(e);
    }
    finally {
      if (isInPlace()) {
        // destinationZip is a temporary file
        FileUtils.deleteQuietly(destinationFile);
      }
    }
  }
1315751
public final static String process(final InputStream input, final Configuration configuration) throws IOException
    {
        final Processor p = new Processor(new BufferedReader(new InputStreamReader(input, configuration.encoding)),
                configuration);
        return p.process();
    }