Home | History | Annotate | Download | only in text
      1 /* GENERATED SOURCE. DO NOT MODIFY. */
      2 //  2016 and later: Unicode, Inc. and others.
      3 // License & terms of use: http://www.unicode.org/copyright.html#License
      4 /*
      5  *******************************************************************************
      6  * Copyright (C) 2012, International Business Machines Corporation and         *
      7  * others. All Rights Reserved.                                                *
      8  *******************************************************************************
      9  */
     10 package android.icu.text;
     11 
     12 import java.text.CharacterIterator;
     13 
     14 /**
     15  * The DictionaryMatcher interface is used to allow arbitrary "types" of
     16  * back-end data structures to be used with the break iteration code.
     17  */
     18 abstract class DictionaryMatcher {
     19     /**
     20      * Find dictionary words that match the text.
     21      *
     22      * @param text A CharacterIterator representing the text. The iterator is
     23      *            left after the longest prefix match in the dictionary.
     24      * @param maxLength The maximum number of code units to match.
     25      * @param lengths An array that is filled with the lengths of words that matched.
     26      * @param count Filled with the number of elements output in lengths.
     27      * @param limit The maximum amount of words to output. Must be less than or equal to lengths.length.
     28      * @param values Filled with the weight values associated with the various words.
     29      * @return The number of characters in text that were matched.
     30      */
     31     public abstract int matches(CharacterIterator text, int maxLength, int[] lengths,
     32             int[] count, int limit, int[] values);
     33 
     34     public int matches(CharacterIterator text, int maxLength, int[] lengths,
     35             int[] count, int limit) {
     36         return matches(text, maxLength, lengths, count, limit, null);
     37     }
     38 
     39     /**
     40      * @return the kind of dictionary that this matcher is using
     41      */
     42     public abstract int getType();
     43 }
     44