LanguageAnalysis.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. {
  2. File: LangAnalysis/LanguageAnalysis.h
  3. Contains: Language Analysis Manager Interfaces
  4. Version: LanguageAnalysis-242~23
  5. Copyright: © 1996-2008 by Apple Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$packenum 1}
  20. {$macro on}
  21. {$inline on}
  22. {$calling mwpascal}
  23. unit LanguageAnalysis;
  24. interface
  25. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  26. {$setc GAP_INTERFACES_VERSION := $0308}
  27. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  28. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  29. {$endc}
  30. {$ifc defined CPUPOWERPC and defined CPUI386}
  31. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  32. {$endc}
  33. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  34. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  35. {$endc}
  36. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  37. {$setc __ppc__ := 1}
  38. {$elsec}
  39. {$setc __ppc__ := 0}
  40. {$endc}
  41. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  42. {$setc __ppc64__ := 1}
  43. {$elsec}
  44. {$setc __ppc64__ := 0}
  45. {$endc}
  46. {$ifc not defined __i386__ and defined CPUI386}
  47. {$setc __i386__ := 1}
  48. {$elsec}
  49. {$setc __i386__ := 0}
  50. {$endc}
  51. {$ifc not defined __x86_64__ and defined CPUX86_64}
  52. {$setc __x86_64__ := 1}
  53. {$elsec}
  54. {$setc __x86_64__ := 0}
  55. {$endc}
  56. {$ifc not defined __arm__ and defined CPUARM}
  57. {$setc __arm__ := 1}
  58. {$elsec}
  59. {$setc __arm__ := 0}
  60. {$endc}
  61. {$ifc not defined __arm64__ and defined CPUAARCH64}
  62. {$setc __arm64__ := 1}
  63. {$elsec}
  64. {$setc __arm64__ := 0}
  65. {$endc}
  66. {$ifc defined cpu64}
  67. {$setc __LP64__ := 1}
  68. {$elsec}
  69. {$setc __LP64__ := 0}
  70. {$endc}
  71. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  72. {$error Conflicting definitions for __ppc__ and __i386__}
  73. {$endc}
  74. {$ifc defined __ppc__ and __ppc__}
  75. {$setc TARGET_CPU_PPC := TRUE}
  76. {$setc TARGET_CPU_PPC64 := FALSE}
  77. {$setc TARGET_CPU_X86 := FALSE}
  78. {$setc TARGET_CPU_X86_64 := FALSE}
  79. {$setc TARGET_CPU_ARM := FALSE}
  80. {$setc TARGET_CPU_ARM64 := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_IPHONE := FALSE}
  83. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  84. {$setc TARGET_OS_EMBEDDED := FALSE}
  85. {$elifc defined __ppc64__ and __ppc64__}
  86. {$setc TARGET_CPU_PPC := FALSE}
  87. {$setc TARGET_CPU_PPC64 := TRUE}
  88. {$setc TARGET_CPU_X86 := FALSE}
  89. {$setc TARGET_CPU_X86_64 := FALSE}
  90. {$setc TARGET_CPU_ARM := FALSE}
  91. {$setc TARGET_CPU_ARM64 := FALSE}
  92. {$setc TARGET_OS_MAC := TRUE}
  93. {$setc TARGET_OS_IPHONE := FALSE}
  94. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  95. {$setc TARGET_OS_EMBEDDED := FALSE}
  96. {$elifc defined __i386__ and __i386__}
  97. {$setc TARGET_CPU_PPC := FALSE}
  98. {$setc TARGET_CPU_PPC64 := FALSE}
  99. {$setc TARGET_CPU_X86 := TRUE}
  100. {$setc TARGET_CPU_X86_64 := FALSE}
  101. {$setc TARGET_CPU_ARM := FALSE}
  102. {$setc TARGET_CPU_ARM64 := FALSE}
  103. {$ifc defined(iphonesim)}
  104. {$setc TARGET_OS_MAC := FALSE}
  105. {$setc TARGET_OS_IPHONE := TRUE}
  106. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  107. {$elsec}
  108. {$setc TARGET_OS_MAC := TRUE}
  109. {$setc TARGET_OS_IPHONE := FALSE}
  110. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  111. {$endc}
  112. {$setc TARGET_OS_EMBEDDED := FALSE}
  113. {$elifc defined __x86_64__ and __x86_64__}
  114. {$setc TARGET_CPU_PPC := FALSE}
  115. {$setc TARGET_CPU_PPC64 := FALSE}
  116. {$setc TARGET_CPU_X86 := FALSE}
  117. {$setc TARGET_CPU_X86_64 := TRUE}
  118. {$setc TARGET_CPU_ARM := FALSE}
  119. {$setc TARGET_CPU_ARM64 := FALSE}
  120. {$ifc defined(iphonesim)}
  121. {$setc TARGET_OS_MAC := FALSE}
  122. {$setc TARGET_OS_IPHONE := TRUE}
  123. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  124. {$elsec}
  125. {$setc TARGET_OS_MAC := TRUE}
  126. {$setc TARGET_OS_IPHONE := FALSE}
  127. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  128. {$endc}
  129. {$setc TARGET_OS_EMBEDDED := FALSE}
  130. {$elifc defined __arm__ and __arm__}
  131. {$setc TARGET_CPU_PPC := FALSE}
  132. {$setc TARGET_CPU_PPC64 := FALSE}
  133. {$setc TARGET_CPU_X86 := FALSE}
  134. {$setc TARGET_CPU_X86_64 := FALSE}
  135. {$setc TARGET_CPU_ARM := TRUE}
  136. {$setc TARGET_CPU_ARM64 := FALSE}
  137. { will require compiler define when/if other Apple devices with ARM cpus ship }
  138. {$setc TARGET_OS_MAC := FALSE}
  139. {$setc TARGET_OS_IPHONE := TRUE}
  140. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  141. {$setc TARGET_OS_EMBEDDED := TRUE}
  142. {$elifc defined __arm64__ and __arm64__}
  143. {$setc TARGET_CPU_PPC := FALSE}
  144. {$setc TARGET_CPU_PPC64 := FALSE}
  145. {$setc TARGET_CPU_X86 := FALSE}
  146. {$setc TARGET_CPU_X86_64 := FALSE}
  147. {$setc TARGET_CPU_ARM := FALSE}
  148. {$setc TARGET_CPU_ARM64 := TRUE}
  149. { will require compiler define when/if other Apple devices with ARM cpus ship }
  150. {$setc TARGET_OS_MAC := FALSE}
  151. {$setc TARGET_OS_IPHONE := TRUE}
  152. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  153. {$setc TARGET_OS_EMBEDDED := TRUE}
  154. {$elsec}
  155. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  156. {$endc}
  157. {$ifc defined __LP64__ and __LP64__ }
  158. {$setc TARGET_CPU_64 := TRUE}
  159. {$elsec}
  160. {$setc TARGET_CPU_64 := FALSE}
  161. {$endc}
  162. {$ifc defined FPC_BIG_ENDIAN}
  163. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  164. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  165. {$elifc defined FPC_LITTLE_ENDIAN}
  166. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  167. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  168. {$elsec}
  169. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  170. {$endc}
  171. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  172. {$setc CALL_NOT_IN_CARBON := FALSE}
  173. {$setc OLDROUTINENAMES := FALSE}
  174. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  175. {$setc OPAQUE_UPP_TYPES := TRUE}
  176. {$setc OTCARBONAPPLICATION := TRUE}
  177. {$setc OTKERNEL := FALSE}
  178. {$setc PM_USE_SESSION_APIS := TRUE}
  179. {$setc TARGET_API_MAC_CARBON := TRUE}
  180. {$setc TARGET_API_MAC_OS8 := FALSE}
  181. {$setc TARGET_API_MAC_OSX := TRUE}
  182. {$setc TARGET_CARBON := TRUE}
  183. {$setc TARGET_CPU_68K := FALSE}
  184. {$setc TARGET_CPU_MIPS := FALSE}
  185. {$setc TARGET_CPU_SPARC := FALSE}
  186. {$setc TARGET_OS_UNIX := FALSE}
  187. {$setc TARGET_OS_WIN32 := FALSE}
  188. {$setc TARGET_RT_MAC_68881 := FALSE}
  189. {$setc TARGET_RT_MAC_CFM := FALSE}
  190. {$setc TARGET_RT_MAC_MACHO := TRUE}
  191. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  192. {$setc TYPE_BOOL := FALSE}
  193. {$setc TYPE_EXTENDED := FALSE}
  194. {$setc TYPE_LONGLONG := TRUE}
  195. uses MacTypes,AEDataModel,Files,AERegistry,Dictionary,TextCommon,MacErrors;
  196. {$endc} {not MACOSALLINCLUDE}
  197. {$ifc TARGET_OS_MAC}
  198. {$ALIGN POWER}
  199. type
  200. LAEnvironmentRef = ^OpaqueLAEnvironmentRef; { an opaque type }
  201. OpaqueLAEnvironmentRef = record end;
  202. LAEnvironmentRefPtr = ^LAEnvironmentRef; { when a var xx:LAEnvironmentRef parameter can be nil, it is changed to xx: LAEnvironmentRefPtr }
  203. LAContextRef = ^OpaqueLAContextRef; { an opaque type }
  204. OpaqueLAContextRef = record end;
  205. LAContextRefPtr = ^LAContextRef; { when a var xx:LAContextRef parameter can be nil, it is changed to xx: LAContextRefPtr }
  206. LAPropertyKey = AEKeyword;
  207. LAPropertyType = DescType;
  208. {
  209. Data structure for high level API
  210. }
  211. type
  212. LAMorphemeRecPtr = ^LAMorphemeRec;
  213. LAMorphemeRec = record
  214. sourceTextLength: UInt32;
  215. sourceTextPtr: LogicalAddress;
  216. morphemeTextLength: UInt32;
  217. morphemeTextPtr: LogicalAddress;
  218. partOfSpeech: UInt32;
  219. end;
  220. type
  221. LAMorphemesArrayPtr = ^LAMorphemesArray;
  222. LAMorphemesArray = record
  223. morphemesCount: ItemCount;
  224. processedTextLength: UInt32;
  225. morphemesTextLength: UInt32;
  226. morphemes: array [0..1-1] of LAMorphemeRec;
  227. end;
  228. const
  229. kLAMorphemesArrayVersion = 0;
  230. {
  231. Definitions for result path/bundle structure
  232. }
  233. type
  234. LAMorphemeBundle = AERecord;
  235. LAMorphemeBundlePtr = ^LAMorphemeBundle;
  236. LAMorphemePath = AERecord;
  237. LAMorphemePathPtr = ^LAMorphemePath;
  238. LAMorpheme = AERecord;
  239. LAMorphemePtr = ^LAMorpheme;
  240. LAHomograph = AERecord;
  241. LAHomographPtr = ^LAHomograph;
  242. const
  243. keyAELAMorphemeBundle = FourCharCode('lmfb');
  244. keyAELAMorphemePath = FourCharCode('lmfp');
  245. keyAELAMorpheme = FourCharCode('lmfn');
  246. keyAELAHomograph = FourCharCode('lmfh');
  247. const
  248. typeLAMorphemeBundle = typeAERecord;
  249. typeLAMorphemePath = typeAERecord;
  250. typeLAMorpheme = typeAEList;
  251. typeLAHomograph = typeAEList;
  252. {
  253. Definitions for morpheme/homograph information
  254. }
  255. const
  256. keyAEMorphemePartOfSpeechCode = FourCharCode('lamc');
  257. keyAEMorphemeTextRange = FourCharCode('lamt');
  258. const
  259. typeAEMorphemePartOfSpeechCode = FourCharCode('lamc');
  260. typeAEMorphemeTextRange = FourCharCode('lamt');
  261. type
  262. MorphemePartOfSpeech = UInt32;
  263. MorphemeTextRange = record
  264. sourceOffset: UInt32;
  265. length: UInt32;
  266. end;
  267. {
  268. Mask for High level API convert flags
  269. }
  270. const
  271. kLAEndOfSourceTextMask = $00000001;
  272. {
  273. Constants for leading/trailing path of analysis function
  274. }
  275. const
  276. kLADefaultEdge = 0;
  277. kLAFreeEdge = 1;
  278. kLAIncompleteEdge = 2;
  279. {
  280. Constants for confirm and shift function
  281. }
  282. const
  283. kLAAllMorphemes = 0;
  284. {$ifc not TARGET_CPU_64}
  285. {
  286. Library version
  287. }
  288. {$ifc not TARGET_CPU_64}
  289. {
  290. * LALibraryVersion() *** DEPRECATED ***
  291. *
  292. * Deprecated:
  293. * The Language Analysis Manager is deprecated. Use
  294. * CFStringTokenizer instead.
  295. *
  296. * Availability:
  297. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  298. * CarbonLib: in CarbonLib 1.0 and later
  299. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  300. }
  301. function LALibraryVersion: UInt32; external name '_LALibraryVersion';
  302. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  303. {
  304. High level API
  305. }
  306. {
  307. * LATextToMorphemes() *** DEPRECATED ***
  308. *
  309. * Deprecated:
  310. * The Language Analysis Manager is deprecated. Use
  311. * CFStringTokenizer instead.
  312. *
  313. * Availability:
  314. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  315. * CarbonLib: in CarbonLib 1.0 and later
  316. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  317. }
  318. function LATextToMorphemes( context: LAContextRef; preferedEncoding: TextEncoding; textLength: ByteCount; sourceText: ConstLogicalAddress; bufferSize: ByteCount; convertFlags: OptionBits; structureVersion: UInt32; var acceptedLength: ByteCount; resultBuffer: LAMorphemesArrayPtr ): OSStatus; external name '_LATextToMorphemes';
  319. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  320. {
  321. Handling Context
  322. }
  323. {
  324. * LAOpenAnalysisContext() *** DEPRECATED ***
  325. *
  326. * Deprecated:
  327. * The Language Analysis Manager is deprecated. Use
  328. * CFStringTokenizer instead.
  329. *
  330. * Availability:
  331. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  332. * CarbonLib: in CarbonLib 1.0 and later
  333. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  334. }
  335. function LAOpenAnalysisContext( environ: LAEnvironmentRef; var context: LAContextRef ): OSStatus; external name '_LAOpenAnalysisContext';
  336. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  337. {
  338. * LACloseAnalysisContext() *** DEPRECATED ***
  339. *
  340. * Deprecated:
  341. * The Language Analysis Manager is deprecated. Use
  342. * CFStringTokenizer instead.
  343. *
  344. * Availability:
  345. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  346. * CarbonLib: in CarbonLib 1.0 and later
  347. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  348. }
  349. function LACloseAnalysisContext( context: LAContextRef ): OSStatus; external name '_LACloseAnalysisContext';
  350. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  351. {
  352. Handling Environment
  353. }
  354. {
  355. * LAGetEnvironmentList() *** DEPRECATED ***
  356. *
  357. * Deprecated:
  358. * The Language Analysis Manager is deprecated. Use
  359. * CFStringTokenizer instead.
  360. *
  361. * Availability:
  362. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  363. * CarbonLib: in CarbonLib 1.0 and later
  364. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  365. }
  366. function LAGetEnvironmentList( maxCount: UInt32; var actualCount: UInt32; environmentList: {variable-size-array} LAEnvironmentRefPtr ): OSStatus; external name '_LAGetEnvironmentList';
  367. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  368. {
  369. * LAGetEnvironmentName() *** DEPRECATED ***
  370. *
  371. * Deprecated:
  372. * The Language Analysis Manager is deprecated. Use
  373. * CFStringTokenizer instead.
  374. *
  375. * Availability:
  376. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  377. * CarbonLib: in CarbonLib 1.0 and later
  378. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  379. }
  380. function LAGetEnvironmentName( environment: LAEnvironmentRef; var environmentName: Str63 ): OSStatus; external name '_LAGetEnvironmentName';
  381. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  382. {
  383. * LAGetEnvironmentRef() *** DEPRECATED ***
  384. *
  385. * Deprecated:
  386. * The Language Analysis Manager is deprecated. Use
  387. * CFStringTokenizer instead.
  388. *
  389. * Availability:
  390. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  391. * CarbonLib: in CarbonLib 1.0 and later
  392. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  393. }
  394. function LAGetEnvironmentRef( const (*var*) targetEnvironmentName: Str63; var environment: LAEnvironmentRef ): OSStatus; external name '_LAGetEnvironmentRef';
  395. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  396. {
  397. * LACreateCustomEnvironment() *** DEPRECATED ***
  398. *
  399. * Deprecated:
  400. * The Language Analysis Manager is deprecated. Use
  401. * CFStringTokenizer instead.
  402. *
  403. * Availability:
  404. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  405. * CarbonLib: in CarbonLib 1.0 and later
  406. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  407. }
  408. function LACreateCustomEnvironment( baseEnvironment: LAEnvironmentRef; const (*var*) newEnvironmentName: Str63; persistent: Boolean; var newEnvironment: LAEnvironmentRef ): OSStatus; external name '_LACreateCustomEnvironment';
  409. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  410. {
  411. * LADeleteCustomEnvironment() *** DEPRECATED ***
  412. *
  413. * Deprecated:
  414. * The Language Analysis Manager is deprecated. Use
  415. * CFStringTokenizer instead.
  416. *
  417. * Availability:
  418. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  419. * CarbonLib: in CarbonLib 1.0 and later
  420. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  421. }
  422. function LADeleteCustomEnvironment( environment: LAEnvironmentRef ): OSStatus; external name '_LADeleteCustomEnvironment';
  423. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  424. {
  425. Handling dictionries
  426. }
  427. {
  428. * LAOpenDictionary() *** DEPRECATED ***
  429. *
  430. * Deprecated:
  431. * The Language Analysis Manager is deprecated. Use
  432. * CFStringTokenizer instead.
  433. *
  434. * Availability:
  435. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  436. * CarbonLib: in CarbonLib 1.0 and later
  437. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  438. }
  439. function LAOpenDictionary( environ: LAEnvironmentRef; const (*var*) dictionary: FSSpec ): OSStatus; external name '_LAOpenDictionary';
  440. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  441. {
  442. * LACloseDictionary() *** DEPRECATED ***
  443. *
  444. * Deprecated:
  445. * The Language Analysis Manager is deprecated. Use
  446. * CFStringTokenizer instead.
  447. *
  448. * Availability:
  449. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  450. * CarbonLib: in CarbonLib 1.0 and later
  451. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  452. }
  453. function LACloseDictionary( environ: LAEnvironmentRef; const (*var*) dictionary: FSSpec ): OSStatus; external name '_LACloseDictionary';
  454. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  455. {
  456. * LAListAvailableDictionaries() *** DEPRECATED ***
  457. *
  458. * Deprecated:
  459. * The Language Analysis Manager is deprecated. Use
  460. * CFStringTokenizer instead.
  461. *
  462. * Availability:
  463. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  464. * CarbonLib: in CarbonLib 1.0 and later
  465. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  466. }
  467. function LAListAvailableDictionaries( environ: LAEnvironmentRef; maxCount: ItemCount; var actualCount: ItemCount; dictionaryList: {variable-size-array} FSSpecPtr; opened: {variable-size-array} BooleanPtr ): OSStatus; external name '_LAListAvailableDictionaries';
  468. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  469. {
  470. * LAAddNewWord() *** DEPRECATED ***
  471. *
  472. * Deprecated:
  473. * The Language Analysis Manager is deprecated. Use
  474. * CFStringTokenizer instead.
  475. *
  476. * Availability:
  477. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  478. * CarbonLib: in CarbonLib 1.0 and later
  479. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  480. }
  481. function LAAddNewWord( environ: LAEnvironmentRef; const (*var*) dictionary: FSSpec; const (*var*) dataList: AEDesc ): OSStatus; external name '_LAAddNewWord';
  482. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  483. {
  484. Analyzing text
  485. }
  486. {
  487. * LAMorphemeAnalysis() *** DEPRECATED ***
  488. *
  489. * Deprecated:
  490. * The Language Analysis Manager is deprecated. Use
  491. * CFStringTokenizer instead.
  492. *
  493. * Availability:
  494. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  495. * CarbonLib: in CarbonLib 1.0 and later
  496. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  497. }
  498. function LAMorphemeAnalysis( context: LAContextRef; text: ConstUniCharArrayPtr; textLength: UniCharCount; var leadingPath: LAMorphemePath; var trailingPath: LAMorphemePath; pathCount: ItemCount; var result: LAMorphemeBundle ): OSStatus; external name '_LAMorphemeAnalysis';
  499. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  500. {
  501. * LAContinuousMorphemeAnalysis() *** DEPRECATED ***
  502. *
  503. * Deprecated:
  504. * The Language Analysis Manager is deprecated. Use
  505. * CFStringTokenizer instead.
  506. *
  507. * Availability:
  508. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  509. * CarbonLib: in CarbonLib 1.0 and later
  510. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  511. }
  512. function LAContinuousMorphemeAnalysis( context: LAContextRef; text: ConstUniCharArrayPtr; textLength: UniCharCount; incrementalText: Boolean; var leadingPath: LAMorphemePath; var trailingPath: LAMorphemePath; var modified: Boolean ): OSStatus; external name '_LAContinuousMorphemeAnalysis';
  513. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  514. {
  515. * LAGetMorphemes() *** DEPRECATED ***
  516. *
  517. * Deprecated:
  518. * The Language Analysis Manager is deprecated. Use
  519. * CFStringTokenizer instead.
  520. *
  521. * Availability:
  522. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  523. * CarbonLib: in CarbonLib 1.0 and later
  524. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  525. }
  526. function LAGetMorphemes( context: LAContextRef; var result: LAMorphemePath ): OSStatus; external name '_LAGetMorphemes';
  527. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  528. {
  529. * LAShiftMorphemes() *** DEPRECATED ***
  530. *
  531. * Deprecated:
  532. * The Language Analysis Manager is deprecated. Use
  533. * CFStringTokenizer instead.
  534. *
  535. * Availability:
  536. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  537. * CarbonLib: in CarbonLib 1.0 and later
  538. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  539. }
  540. function LAShiftMorphemes( context: LAContextRef; morphemeCount: ItemCount; var path: LAMorphemePath; var shiftedLength: UniCharCount ): OSStatus; external name '_LAShiftMorphemes';
  541. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  542. {
  543. * LAResetAnalysis() *** DEPRECATED ***
  544. *
  545. * Deprecated:
  546. * The Language Analysis Manager is deprecated. Use
  547. * CFStringTokenizer instead.
  548. *
  549. * Availability:
  550. * Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
  551. * CarbonLib: in CarbonLib 1.0 and later
  552. * Non-Carbon CFM: in LanguageAnalysisLib 1.0 and later
  553. }
  554. function LAResetAnalysis( context: LAContextRef ): OSStatus; external name '_LAResetAnalysis';
  555. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
  556. {$endc} {not TARGET_CPU_64}
  557. {$endc} {not TARGET_CPU_64}
  558. {
  559. Check Language Analysis Manager availability
  560. }
  561. {$ifc TARGET_RT_MAC_CFM}
  562. {
  563. LALanguageAnalysisAvailable() is a macro available only in C/C++.
  564. To get the same functionality from pascal or assembly, you need
  565. to test if Language Analysis Manager functions are not NULL.
  566. For instance:
  567. IF @LALibraryVersion <> kUnresolvedCFragSymbolAddress THEN
  568. gLanguageAnalysisAvailable = TRUE;
  569. ELSE
  570. gLanguageAnalysisAvailable = FALSE;
  571. end
  572. }
  573. {$elsec}
  574. {$ifc TARGET_RT_MAC_MACHO}
  575. { Language Analysis Manager is always available on OS X }
  576. {$endc}
  577. {$endc}
  578. {
  579. =============================================================================================
  580. Definitions for Japanese Analysis Module
  581. =============================================================================================
  582. }
  583. {
  584. Names for default environments for Japanese analysis
  585. }
  586. const
  587. kLAJapaneseKanaKanjiEnvironment = 'KanaKanjiConversion';
  588. const
  589. kLAJapaneseMorphemeAnalysisEnvironment = 'JapaneseMorphemeAnalysis';
  590. const
  591. kLAJapaneseTTSEnvironment = 'JapaneseTextToSpeech';
  592. {
  593. File cretor for dictionary of Apple Japanese access method
  594. }
  595. const
  596. kAppleJapaneseDictionarySignature = FourCharCode('jlan');
  597. {
  598. Engine limitations
  599. }
  600. const
  601. kMaxInputLengthOfAppleJapaneseEngine = 200;
  602. {
  603. Definitions of information in the path/bundle
  604. }
  605. type
  606. JapanesePartOfSpeech = MorphemePartOfSpeech;
  607. HomographWeight = UInt16;
  608. HomographAccent = UInt8;
  609. {
  610. AE keywords and type definitions for morpheme/homograph information
  611. }
  612. const
  613. keyAEHomographDicInfo = FourCharCode('lahd');
  614. keyAEHomographWeight = FourCharCode('lahw');
  615. keyAEHomographAccent = FourCharCode('laha');
  616. const
  617. typeAEHomographDicInfo = FourCharCode('lahd');
  618. typeAEHomographWeight = typeSInt16;
  619. typeAEHomographAccent = FourCharCode('laha');
  620. {
  621. Structure for dictionary information of homograph
  622. }
  623. type
  624. HomographDicInfoRecPtr = ^HomographDicInfoRec;
  625. HomographDicInfoRec = record
  626. dictionaryID: DCMDictionaryID;
  627. uniqueID: DCMUniqueID;
  628. end;
  629. {
  630. =============================================================================================
  631. Definitions for Japanese part of speeches
  632. =============================================================================================
  633. }
  634. {
  635. Masks for part of speeches
  636. }
  637. const
  638. kLASpeechRoughClassMask = $0000F000;
  639. kLASpeechMediumClassMask = $0000FF00;
  640. kLASpeechStrictClassMask = $0000FFF0;
  641. kLASpeechKatsuyouMask = $0000000F;
  642. {
  643. Part of speeches
  644. }
  645. const
  646. kLASpeechMeishi = $00000000; { noun }
  647. kLASpeechFutsuuMeishi = $00000000; { general noun }
  648. kLASpeechJinmei = $00000100; { person name }
  649. kLASpeechJinmeiSei = $00000110; { family name }
  650. kLASpeechJinmeiMei = $00000120; { first name }
  651. kLASpeechChimei = $00000200; { place name }
  652. kLASpeechSetsubiChimei = $00000210; { place name with suffix }
  653. kLASpeechSoshikimei = $00000300; { organization name }
  654. kLASpeechKoyuuMeishi = $00000400; { proper noun }
  655. kLASpeechSahenMeishi = $00000500; { special noun }
  656. kLASpeechKeidouMeishi = $00000600; { special noun }
  657. kLASpeechRentaishi = $00001000;
  658. kLASpeechFukushi = $00002000; { adverb }
  659. kLASpeechSetsuzokushi = $00003000; { conjunction }
  660. kLASpeechKandoushi = $00004000;
  661. kLASpeechDoushi = $00005000; { verb }
  662. kLASpeechGodanDoushi = $00005000;
  663. kLASpeechKagyouGodan = $00005000;
  664. kLASpeechSagyouGodan = $00005010;
  665. kLASpeechTagyouGodan = $00005020;
  666. kLASpeechNagyouGodan = $00005030;
  667. kLASpeechMagyouGodan = $00005040;
  668. kLASpeechRagyouGodan = $00005050;
  669. kLASpeechWagyouGodan = $00005060;
  670. kLASpeechGagyouGodan = $00005070;
  671. kLASpeechBagyouGodan = $00005080;
  672. kLASpeechIchidanDoushi = $00005100;
  673. kLASpeechKahenDoushi = $00005200;
  674. kLASpeechSahenDoushi = $00005300;
  675. kLASpeechZahenDoushi = $00005400;
  676. kLASpeechKeiyoushi = $00006000; { adjective }
  677. kLASpeechKeiyoudoushi = $00007000;
  678. kLASpeechSettougo = $00008000; { prefix}
  679. kLASpeechSuujiSettougo = $00008100; { prefix for numbers }
  680. kLASpeechSetsubigo = $00009000; { suffix }
  681. kLASpeechJinmeiSetsubigo = $00009100; { suffix for person name }
  682. kLASpeechChimeiSetsubigo = $00009200; { suffix for place name }
  683. kLASpeechSoshikimeiSetsubigo = $00009300; { suffix for organization name }
  684. kLASpeechSuujiSetsubigo = $00009400; { suffix for numbers }
  685. kLASpeechMuhinshi = $0000A000; { no category }
  686. kLASpeechTankanji = $0000A000; { character }
  687. kLASpeechKigou = $0000A100; { symbol }
  688. kLASpeechKuten = $0000A110;
  689. kLASpeechTouten = $0000A120;
  690. kLASpeechSuushi = $0000A200; { numbers }
  691. kLASpeechDokuritsugo = $0000A300;
  692. kLASpeechSeiku = $0000A400;
  693. kLASpeechJodoushi = $0000B000; { auxiliary verb }
  694. kLASpeechJoshi = $0000C000; { postpositional particle }
  695. {
  696. Conjugations
  697. }
  698. const
  699. kLASpeechKatsuyouGokan = $00000001; { stem }
  700. kLASpeechKatsuyouMizen = $00000002;
  701. kLASpeechKatsuyouRenyou = $00000003;
  702. kLASpeechKatsuyouSyuushi = $00000004;
  703. kLASpeechKatsuyouRentai = $00000005;
  704. kLASpeechKatsuyouKatei = $00000006;
  705. kLASpeechKatsuyouMeirei = $00000007;
  706. {$endc} {TARGET_OS_MAC}
  707. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  708. end.
  709. {$endc} {not MACOSALLINCLUDE}