class HanLPAnalyzer implements Analyzer {

    public static final List<String> SUPPORT_MODES =
            ImmutableList.<String>builder()
                         .add("standard")
                         .add("nlp")
                         .add("index")
                         .add("nShort")
                         .add("shortest")
                         .add("speed")
                         .build();

    private static final Segment N_SHORT_SEGMENT =
            new NShortSegment().enableCustomDictionary(false)
                               .enablePlaceRecognize(true)
                               .enableOrganizationRecognize(true);
    private static final Segment DIJKSTRA_SEGMENT =
            new DijkstraSegment().enableCustomDictionary(false)
                                 .enablePlaceRecognize(true)
                                 .enableOrganizationRecognize(true);

    private final String tokenizer;

    public HanLPAnalyzer(String mode) {
        if (!SUPPORT_MODES.contains(mode)) {
            throw new ConfigException(
                    "Unsupported segment mode '%s' for hanlp analyzer, " +
                    "the available values are %s", mode, SUPPORT_MODES);
        }
        this.tokenizer = mode;
    }

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

        List<Term> terms;
        switch (this.tokenizer) {
            case "standard":
                terms = StandardTokenizer.segment(text);
                break;
            case "nlp":
                terms = NLPTokenizer.segment(text);
                break;
            case "index":
                terms = IndexTokenizer.segment(text);
                break;
            case "nShort":
                terms = N_SHORT_SEGMENT.seg(text);
                break;
            case "shortest":
                terms = DIJKSTRA_SEGMENT.seg(text);
                break;
            case "speed":
                terms = SpeedTokenizer.segment(text);
                break;
            default:
                throw new AssertionError(String.format(
                        "Unsupported segment mode '%s'", this.tokenizer));
        }

        assert terms != null;
        Set<String> result = InsertionOrderUtil.newSet();
        for (Term term : terms) {
            result.add(term.word);
        }
        return result;
    
<no_super_class>