Ejemplo n.º 1
0
        /// <summary>
        /// Queries the specified tokens.
        /// </summary>
        /// <param name="tokens">The tokens.</param>
        /// <param name="scope">The scope.</param>
        /// <param name="side">The side.</param>
        /// <returns></returns>
        public apertiumDictionaryResult query(IEnumerable <String> tokens, apertiumDictQueryScope scope = apertiumDictQueryScope.startingWith, apertiumDictNeedleSide side = apertiumDictNeedleSide.native)
        {
            apertiumDictionaryResult output    = new apertiumDictionaryResult();
            List <String>            queryList = new List <string>();

            foreach (String tkn in tokens)
            {
                if (!tkn.isNullOrEmpty())
                {
                    queryList.Add(makeQuery(tkn, scope, side));
                }
            }


            var res = dictionaryOperator.Search(queryList, true, RegexOptions.IgnoreCase);


            foreach (String line in res.getLines(true))
            {
                output.addLine(line);
            }


            return(output);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Queries for synonyms.
        /// </summary>
        /// <param name="token">The token.</param>
        /// <param name="scope">The scope.</param>
        /// <returns></returns>
        public apertiumDictionaryResult queryForSynonyms(String token, apertiumDictQueryScope scope = apertiumDictQueryScope.startingWith)
        {
            apertiumDictionaryResult output    = new apertiumDictionaryResult();
            apertiumDictionaryResult firstStep = query(token, scope, apertiumDictNeedleSide.native);
            var engList = firstStep.GetTranslatedWords();

            output = query(engList, scope, apertiumDictNeedleSide.translated);
            return(output);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Queries for synonyms.
        /// </summary>
        /// <param name="token">The token.</param>
        /// <param name="scope">The scope.</param>
        /// <returns></returns>
        public apertiumDictionaryResult queryForSynonyms(String token, apertiumDictQueryScope scope = apertiumDictQueryScope.startingWith)
        {
            apertiumDictionaryResult output    = new apertiumDictionaryResult();
            apertiumDictionaryResult firstStep = query(token, scope, apertiumDictNeedleSide.serbian);
            var engList = firstStep.GetEnglish();

            output = query(engList, scope, apertiumDictNeedleSide.english);
            return(output);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Queries the specified token
        /// </summary>
        /// <param name="token">The token.</param>
        /// <param name="scope">The scope.</param>
        /// <param name="side">The side.</param>
        /// <returns></returns>
        public apertiumDictionaryResult query(String token, apertiumDictQueryScope scope = apertiumDictQueryScope.startingWith, apertiumDictNeedleSide side = apertiumDictNeedleSide.native)
        {
            apertiumDictionaryResult output = new apertiumDictionaryResult();
            String query = makeQuery(token, scope, side);

            fileTextSearchResult res = dictionaryOperator.Search(query, true, 50, RegexOptions.IgnoreCase);

            foreach (var pair in res)
            {
                output.addLine(pair.Value);
            }

            return(output);
        }