Core.API.DocumentId.GetLearningId C# (CSharp) Method

GetLearningId() public method

public GetLearningId ( ) : string
return string
        public string GetLearningId()
        {
            return string.IsNullOrWhiteSpace(_learningId) ? GetSha1() : _learningId;
        }

Usage Example

Ejemplo n.º 1
0
        private void LearnCommandForInput(IndexWriter writer, IndexReader reader, DocumentId completionId, string input)
        {
            // fickle command, isn't learnable
            if (completionId == null) return;

            var document = CoreDocument.Rehydrate(PopDocument(writer, reader, completionId.GetId()));

            if (document == null)
                throw new InvalidOperationException(string.Format("Didn't find command {0}", completionId));

            var learnings = _learningRepository.LearnFor(input, completionId.GetLearningId());

            document.SetLearnings(learnings);

            writer.AddDocument(document);
        }