S[] findMeaningfulWordSplit(S)(S word,
                                   HLang[] langs = []) if
(isSomeString!S)
    {
        S second = word;
        for (size_t i = 1; i + 1 < word.length; i++)
        {
            second = second.dropExactly(i).to!string;
            const first = word[0..$-second.length];
            if (this.canMeanSomething(first, langs) &&
                this.canMeanSomething(second, langs))
            {
                return [first,
                        second];
            }
        }
        return typeof(return).init;
    }

Reply via email to