home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 6.3 KB | 220 lines | [TEXT/MPS ] |
- /*
- File: LanguageAnalysis.h
-
- Contains: Language Analysis Manager Interfaces
-
- Version: Technology: System 8
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __LANGUAGEANALYSIS__
- #define __LANGUAGEANALYSIS__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __AEDATAMODEL__
- #include <AEDataModel.h>
- #endif
- #ifndef __AEREGISTRY__
- #include <AERegistry.h>
- #endif
- #ifndef __FILEMANAGERTYPES__
- #include <FileManagerTypes.h>
- #endif
- #ifndef __LOCALEOBJECTS__
- #include <LocaleObjects.h>
- #endif
- #ifndef __DICTIONARY__
- #include <Dictionary.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=power
- /* the following contents can only be used by compilers that support PowerPC struct alignment */
-
- #if FOR_SYSTEM8_PREEMPTIVE
- #if FOR_PTR_BASED_AE
- typedef UInt32 LAItemOffset;
- typedef LocaleObjectRef LAEnvironmentLocaleObjectRef;
- typedef struct OpaqueLAContextRef* LAContextRef;
- typedef AEKeyword LAPropertyKey;
- typedef DescType LAPropertyType;
- /*
- Names for Environment Locale Object Attribute Names and Values
- */
- #define kLAAnalysisClassName "\pLAAnalysisClass"
- #define kLAJapaneseKanaKanjiClass "\pKanaKanjiConversion"
- /* Japanese Kana-Kanji conversion*/
- #define kLAJapaneseTTSClass "\pTextToSpeech"
- /* Japanese TTS*/
- #define kLAMorphemeAnalysisClass "\pMophemeAnalysis"
- /* General Morpheme Analysis*/
- /*
- Tags for Environment Properties
- */
-
- enum {
- keyAELAAutoLearning = 'laal', /* Boolean*/
- keyAELALearningDictionary = 'lald', /* Some permanent file specification*/
- keyAELADictionaryList = 'ladc' /* AEList which has a list of dictionary informaion.*/
- };
-
- /*
- Tags for dictionary information
- */
-
- enum {
- keyAELADictionaryFile = 'dfil', /* Some permanent file specification*/
- keyAELADictionaryWeight = 'dwgt', /* Int32*/
- keyAELADictionaryID = 'did ' /* DictionaryID (r/o, volatile)*/
- };
-
- typedef AERecord LAMorphemeBundle;
- typedef AERecord LAMorphemePath;
- typedef AERecord LAMorpheme;
- typedef AERecord LAHomograph;
-
- enum {
- typeLAMorphemeBundle = 'lmfb',
- typeLAMorphemePath = 'lmfp',
- typeLAMorpheme = 'lmfn',
- typeLAHomograph = 'lmfh'
- };
-
-
- enum {
- keyAELAMorphemeBundle = 'lmfb',
- keyAELAMorphemePath = 'lmfp',
- keyAELAMorpheme = 'lmfn',
- keyAELAHomograph = 'lmfh'
- };
-
-
- enum {
- kLADefaultEdge = 0,
- kLAFreeEdge = 1,
- kLAIncompleteEdge = 2
- };
-
-
- enum {
- kAllMorphemes = -1
- };
-
-
- enum {
- kNoContext = 0
- };
-
- typedef OptionBits LAFeedbackType;
-
- enum {
- kLAAcceptedAsIs = 0,
- kLAHomophoneSelected = 1 << 0,
- kLALocalReanalysis = 1 << 1,
- kLATransLiterate = 1 << 2
- };
-
- /*
- Error Value
- */
-
- enum {
- laEngineNotFoundErr = -7000, /* can't find the engine*/
- laPropertyErr = -7001, /* Error in properties*/
- laPropertyNotFoundErr = -7002, /* can't find the property*/
- laPropertyIsReadOnlyErr = -7003, /* the property is read only*/
- laPropertyUnknownErr = -7004, /* the property is unknown to this environment*/
- laPropertyValueErr = -7005, /* Invalid property value*/
- laDictionaryTooManyErr = -7006, /* too many dictionaries*/
- laDictionaryUnknownErr = -7007, /* can't use this dictionary with this environment*/
- laDictionaryNotOpenedErr = -7008, /* the dictionary is not opened*/
- laTextOverFlowErr = -7009, /* text is too long*/
- laFailAnalysisErr = -7010, /* analysis failed*/
- laNoMoreMorphemeErr = -7011 /* nothing to read*/
- };
-
- /*
- Handling Context
- */
- extern OSStatus LAOpenContext(LAEnvironmentLocaleObjectRef environ, LAContextRef *context, OSStatus *specificErr, AERecord *which);
-
- extern OSStatus LACloseContext(LAContextRef context);
-
- /*
- Handling Environment
- */
- extern OSStatus LAGetEnvironmentProperty(LAEnvironmentLocaleObjectRef environment, LAPropertyKey propertyKey, LAPropertyType desiredType, ByteCount maxSize, LAPropertyType *actualType, ByteCount *actualSize, LogicalAddress value);
-
- extern OSStatus LASetEnvironmentProperty(LAEnvironmentLocaleObjectRef environment, LAPropertyKey propertyKey, LAPropertyType propertyType, ByteCount valueSize, ConstLogicalAddress value, OSStatus *specificErr);
-
- /*
- Handling dictionries
- */
- extern OSStatus LAOpenDictionary(LAEnvironmentLocaleObjectRef environ, DCMDictionaryID dictionaryID, AERecord *dictionaryProperty);
-
- extern OSStatus LACloseDictionary(LAEnvironmentLocaleObjectRef environ, DCMDictionaryID dictionary);
-
- extern OSStatus LAListAvailableDictionary(LAEnvironmentLocaleObjectRef environ, ItemCount maxCount, ItemCount *actualCount, DCMDictionaryID dictionaryList[]);
-
- /*
- Analyzing text
- */
- extern OSStatus LAMorphemeAnalysis(LAContextRef context, ConstTextObject text, LAMorphemePath *leadingPath, LAMorphemePath *trailingPath, ItemCount pathCount, LAMorphemeBundle *result);
-
- extern OSStatus LAContinuousMorphemeAnalysis(LAContextRef context, ConstTextObject text, Boolean incrementalText, LAMorphemePath *leadingPath, LAMorphemePath *trailingPath, Boolean *modified);
-
- extern OSStatus LAGetMorphemes(LAContextRef context, LAMorphemePath *result);
-
- extern OSStatus LAShiftMorphemes(LAContextRef context, ItemCount morphemeCount, LAMorphemePath *path, ByteCount *byteCount);
-
- extern OSStatus LAResetAnalysis(LAContextRef context);
-
- extern OSStatus LAGetAllHomographs(LAContextRef context, const LAMorphemePath *path, LAItemOffset morphemeOffset, LAMorpheme *morpheme);
-
- extern OSStatus LAGetRootForm(LAContextRef context, const LAMorphemePath *path, LAItemOffset morphemeOffset, LAMorphemePath *rootForm);
-
- /*
- Learning
- */
- extern OSStatus LAFeedbackPath(LAContextRef context, LAMorphemePath path, LAItemOffset startingPosition, ItemCount morphemeCount, LAFeedbackType *feedbackType, Boolean confirmed);
-
- /*
- TextObject interface
- */
- extern OSStatus LAAnnotateTextObjectWithMorpheme(ConstStr255Param analysisClass, ItemCount tagCount, DCMFieldTag *tags, TextObject text);
-
- #endif
- #endif
-
- #pragma options align=reset
- #endif /* PRAGMA_ALIGN_SUPPORTED */
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __LANGUAGEANALYSIS__ */
-
-