Esempio n. 1
0
		internal static extern void addPATRSentenceFinalPunctuation(ref PATRData pPATR_io, IntPtr pszChar_in);
Esempio n. 2
0
		internal static extern int parseAmpleSentenceWithPATR(
					  IntPtr /* WordTemplate ** */ pWords_in,
					  IntPtr /* FILE * */ pOutputFP_in,
					  IntPtr /* char * */          pszOutputFile_in,
					  int             bWarnUnusedFd_in,
					  int             bVerbose_in,
					  int             bWriteAmpleParses_in,
					  uint        uiSentenceCount_in,
					  ref TextControl   pTextControl_in,
					  ref PATRData      pPATR_in);
Esempio n. 3
0
		internal static extern void	clearPATRSentenceFinalPunctuation(ref PATRData pPATR_io);
Esempio n. 4
0
		internal static extern int loadPATRLexicon(IntPtr /*const char **/ pszLexiconFile_in,
				   ref PATRData pPATR_io);
Esempio n. 5
0
		internal static extern void	freePATRInternalMemory(ref PATRData pPATR_in);
Esempio n. 6
0
		internal static extern void	markPATRParseGarbage (ref PATRData pPATR_io);
Esempio n. 7
0
		internal static extern int loadPATRLexiconFromAmple(
						  IntPtr /*const char **/  pszAnalysisFile_in,
						  ref TextControl pTextControl_in,
						  ref PATRData pPATR_in);
Esempio n. 8
0
		internal static extern int	loadPATRGrammar(IntPtr /*const char **/ pszGrammarFile_in,
				   ref PATRData   pPATR_io);
Esempio n. 9
0
		internal static extern void	freePATRGrammar(ref PATRData pPATR_io);
Esempio n. 10
0
		internal static extern void	writePATRParses(IntPtr /* PATREdgeList **/ pParses_in,
					   IntPtr /*FILE **/         pOutputFP_in,
					   IntPtr /* WordTemplate ***/ ppWords_in,
					   IntPtr /* TextControl **/  pTextControl_in,
					   uint uiSentenceCount_in,
					   ref PATRData  /*PATRData **/     pPATR_in);
Esempio n. 11
0
		internal static extern int stringifyPATRParses (
				  IntPtr /*PATREdgeList **/ pParses_in,
				  ref PATRData /*PATRData **/     pPATR_in,
				  string /*const char **/   pszSentence_in,
				  ref IntPtr /*char ***/ ppszBuffer_out);
Esempio n. 12
0
		internal static extern IntPtr /*PATREdgeList* */ 	parseWithPATR(IntPtr /*PATRWord **/ pSentence_in,
						  ref int /*int * */      piStage_out,
						  ref PATRData /*PATRData **/ pPATR_io);
Esempio n. 13
0
		internal static extern void	collectPATRParseGarbage (ref PATRData pPATR_io);
Esempio n. 14
0
		internal static extern IntPtr /*PATRWord* */ convertSentenceToPATRWords(
			IntPtr pszSentence_in,
			IntPtr pOutputFP_in,
			IntPtr pfMorphParser_in /*PATRLexItem * (* pfMorphParser_in)(char * pszWord_in)*/,
			int bWarnUnusedFd_in,
			ref PATRData pPATR_in,
			ref int piErrors);
Esempio n. 15
0
		internal static extern int	parseWithPATRLexicon(
			string           pszSentence_in,
			IntPtr /*FILE **/           pOutputFP_in,
			IntPtr /* PATRLexItem * (* pfMorphParser_in)(char * pszWord_in) */ pfMorphParser_in,
			int              bWarnUnusedFd_in,
			ref PATRData pPATR_in);
Esempio n. 16
0
		internal static extern void	freePATRLexicon(ref PATRData pPATR_io);
Esempio n. 17
0
		public PatrParser()
		{
			m_memory = new PATRMemory();
			m_data = new PATRData();

			m_sTextCtl = new TextControl();

			m_memory.bPreserve = 1;
			m_data.bUnification = 1;

			m_data.eTreeDisplay = (byte)PATRDataDataTypes.eTreeDisplay.PATR_FULL_TREE;
			m_data.eRootGlossFeature = (byte)PATRDataDataTypes.eRootGlossFeature.PATR_ROOT_GLOSS_NO_FEATURE;
			m_data.bGloss = 1;
			m_data.iFeatureDisplay = (byte)(PATRDataDataTypes.iFeatureDisplay.PATR_FEATURE_ON |
									 PATRDataDataTypes.iFeatureDisplay.PATR_FEATURE_TRIM);

			m_data.bCheckCycles = 1;
			m_data.bTopDownFilter = 1;
			m_data.iMaxAmbiguities = 10;
			m_data.cComment = (byte)PATRDataDataTypes.PATR_DEFAULT_COMMENT;
			m_data.bSilent = 1;
			m_data.bShowWarnings = 1;
			m_data.bPromoteDefAtoms = 1;
			m_data.bPropIsFeature = 0;
			// works here

			m_data.pszRecordMarker = Marshal.StringToHGlobalAnsi(szDefaultWordMarker_g);
			m_data.pszWordMarker = Marshal.StringToHGlobalAnsi(szDefaultWordMarker_g);
			m_data.pszGlossMarker = Marshal.StringToHGlobalAnsi(szDefaultGlossMarker_g);
			m_data.pszRootGlossMarker = Marshal.StringToHGlobalAnsi(szDefaultRootGlossMarker_g);
			m_data.pszCategoryMarker = Marshal.StringToHGlobalAnsi(szDefaultCategoryMarker_g);
			m_data.pszFeatureMarker = Marshal.StringToHGlobalAnsi(szDefaultFeatureMarker_g);
			m_data.pMem = Marshal.AllocHGlobal(Marshal.SizeOf(m_memory));
			Marshal.StructureToPtr(m_memory, m_data.pMem, false);

			initPATRSentenceFinalPunctuation(ref m_data);

			m_sTextCtl.cFormatMark = (byte)'\\';
			m_sTextCtl.cAnaAmbig = (byte)'%';
			m_sTextCtl.cTextAmbig = (byte)'%';
			m_sTextCtl.cDecomp = (byte)'-';
#if __MonoCS__
			unsafe
			{
				fixed ( TextControl * p = &m_sTextCtl)
				{
					p->cBarMark[0] = (byte)'|';
					p->bCapitalize[0] = 1;
				}
			}
#else
			m_sTextCtl.cBarMark = (byte)'|';
			m_sTextCtl.bCapitalize = 1;
#endif
			m_sTextCtl.pszBarCodes = Marshal.StringToHGlobalAnsi(szDefaultBarcodes_g);
			m_sTextCtl.bIndividualCapitalize = 1;
			m_sTextCtl.uiMaxAmbigDecap = 500;

			m_ppszLexFiles = null;
			m_pbAnaLexFile = null;

			m_uiLexFileCount = 0;
			m_pszLogFile = null;

			m_encoding = Encoding.Default;
		}
Esempio n. 18
0
		internal static extern void initPATRSentenceFinalPunctuation(ref PATRData p);