Home | History | Annotate | Download | only in answers
      1 /***********************************************************************
      2  * Copyright (C) 2016 and later: Unicode, Inc. and others.
      3  * License & terms of use: http://www.unicode.org/copyright.html#License
      4  ***********************************************************************
      5  ***********************************************************************
      6  * COPYRIGHT:
      7  * Copyright (c) 1999-2002, International Business Machines Corporation and
      8  * others. All Rights Reserved.
      9  ***********************************************************************/
     10 
     11 #include "unicode/translit.h"
     12 #include "unicode/normlzr.h"
     13 
     14 class UnaccentTransliterator : public Transliterator {
     15 
     16  public:
     17 
     18     /**
     19      * Constructor
     20      */
     21     UnaccentTransliterator();
     22 
     23     /**
     24      * Destructor
     25      */
     26     virtual ~UnaccentTransliterator();
     27 
     28  protected:
     29 
     30     /**
     31      * Implement Transliterator API
     32      */
     33     virtual void handleTransliterate(Replaceable& text,
     34                                      UTransPosition& index,
     35                                      UBool incremental) const;
     36 
     37  private:
     38 
     39     /**
     40      * Unaccent a single character using normalizer.
     41      */
     42     UChar unaccent(UChar c) const;
     43 
     44     Normalizer normalizer;
     45 };
     46