예제 #1
0
        private void WriteAnnotation(CodedAnswer answer)
        {
            // don't write comment for non-statistical export
            if (_codedTextExport == false)
            {
                return;
            }

            // if there is a coded answer write out the annotation text,
            if (answer != null)
            {
                var annotationList = Mapper.Map <string, List <Annotation> >(answer.Annotations).ToList();
                //get list of distinct document name from the list
                var docNames     = annotationList.Select(d => d.DocName).Distinct().ToList();
                var combinedText = new StringBuilder(string.Empty);
                foreach (var docuName in docNames)                        // build list of annotations for each document
                {
                    combinedText.AppendFormat("Document: {0}", docuName); // write the document name for the list of annotations
                    combinedText.Append("\r\n\n");
                    var listOfText = string.Join("\r\n\n", annotationList.Where(item => item.DocName == docuName).Select(item => " - " + item.Text.Trim()));
                    combinedText.Append(listOfText);
                    combinedText.Append("\r\n\n");
                }
                _csvWriter.WriteField(combinedText.ToString());
            }
            else
            {
                _csvWriter.WriteField("");
            }
        }
예제 #2
0
        private void WritePincite(CodedAnswer answer)
        {
            // don't write pinsite for non-statistical export
            if (_codedTextExport == false)
            {
                return;
            }

            // if there is an answer write out the pinsite,
            if (answer != null)
            {
                _csvWriter.WriteField(answer.Pincite);
            }
            else
            {
                _csvWriter.WriteField("");
            }
        }