Example #1
0
        public async Task <List <CollocationsMetaData> > GetCollocationsBySentence_Async(Guid corpusId, string word, int direction)
        {
            var collocations = _cacheRepository.GetCollocationsBySentence(corpusId, word, direction);

            if (collocations != null)
            {
                return(await collocations);
            }

            var xd = await _searchCorpusService.GetCollocationsBySentenceAsync(corpusId, word, direction);

            _cacheRepository.InsertIntoCache <CollocationsInfo>(corpusId, word, xd);
            return(await Task.FromResult(xd != null?xd.CollocationsBySentence : null));
        }