class IKAnalyzer implements Analyzer {

    public static final List<String> SUPPORT_MODES = ImmutableList.of(
            "smart",
            "max_word"
    );

    private final boolean smartSegMode;

    public IKAnalyzer(String mode) {
        if (!SUPPORT_MODES.contains(mode)) {
            throw new ConfigException(
                    "Unsupported segment mode '%s' for ikanalyzer, " +
                    "the available values are %s", mode, SUPPORT_MODES);
        }
        this.smartSegMode = SUPPORT_MODES.get(0).equals(mode);
    }

    @Override
    public Set<String> segment(String text) {<FILL_FUNCTION_BODY>}
}

        Set<String> result = InsertionOrderUtil.newSet();
        IKSegmenter ik = new IKSegmenter(new StringReader(text),
                                         this.smartSegMode);
        try {
            Lexeme word;
            while ((word = ik.next()) != null) {
                result.add(word.getLexemeText());
            }
        } catch (Exception e) {
            throw new HugeException("IKAnalyzer segment text '%s' failed",
                                    e, text);
        }
        return result;
    
<no_super_class>