/// <summary> /// 处理文本内容。 /// </summary> /// <param name="nCount">分词数。</param> /// <returns>分词结果数组。</returns> public static result_t[] ParagraphProcessAW(int nCount) { JudgeInit(); result_t[] results = new result_t[nCount]; NLPIR_ParagraphProcessAW(nCount, results); return results; }
/// <summary> /// 处理文本内容。 /// </summary> /// <param name="sParagraph">文本内容。</param> /// <returns>分词结果数组。</returns> public static result_t[] ParagraphProcessA(string sParagraph) { JudgeInit(); int nCount = 0; IntPtr intPtr = NLPIR_ParagraphProcessA(sParagraph, out nCount); result_t[] results = new result_t[nCount]; for (int i = 0; i < nCount; i++, intPtr = new IntPtr( intPtr.ToInt32() + Marshal.SizeOf(typeof(result_t)))) { results[i] = (result_t)Marshal.PtrToStructure(intPtr, typeof(result_t)); } return results; }