Exemplo n.º 1
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;
		}
Exemplo n.º 2
0
		internal static extern IntPtr /*WordTemplate ** */ readSentenceOfTemplates(
						 IntPtr /*FILE * */              pInputFP_in,
						 IntPtr /*const char * */        pszAnaFile_in,
						 IntPtr /*const StringList * */  pFinalPunc_in,
						 ref TextControl pTextCtl_in,
						 IntPtr /*FILE * */	         pLogFP_in);
Exemplo n.º 3
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);
Exemplo n.º 4
0
		internal static extern int loadPATRLexiconFromAmple(
						  IntPtr /*const char **/  pszAnalysisFile_in,
						  ref TextControl pTextControl_in,
						  ref PATRData pPATR_in);