10995b563SAxel Dörfler /* 20995b563SAxel Dörfler Open Tracker License 30995b563SAxel Dörfler 40995b563SAxel Dörfler Terms and Conditions 50995b563SAxel Dörfler 60995b563SAxel Dörfler Copyright (c) 1991-2000, Be Incorporated. All rights reserved. 70995b563SAxel Dörfler 80995b563SAxel Dörfler Permission is hereby granted, free of charge, to any person obtaining a copy of 90995b563SAxel Dörfler this software and associated documentation files (the "Software"), to deal in 100995b563SAxel Dörfler the Software without restriction, including without limitation the rights to 110995b563SAxel Dörfler use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 120995b563SAxel Dörfler of the Software, and to permit persons to whom the Software is furnished to do 130995b563SAxel Dörfler so, subject to the following conditions: 140995b563SAxel Dörfler 150995b563SAxel Dörfler The above copyright notice and this permission notice applies to all licensees 160995b563SAxel Dörfler and shall be included in all copies or substantial portions of the Software. 170995b563SAxel Dörfler 180995b563SAxel Dörfler THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 190995b563SAxel Dörfler IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, 200995b563SAxel Dörfler FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 210995b563SAxel Dörfler BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 220995b563SAxel Dörfler AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION 230995b563SAxel Dörfler WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 240995b563SAxel Dörfler 250995b563SAxel Dörfler Except as contained in this notice, the name of Be Incorporated shall not be 260995b563SAxel Dörfler used in advertising or otherwise to promote the sale, use or other dealings in 270995b563SAxel Dörfler this Software without prior written authorization from Be Incorporated. 280995b563SAxel Dörfler 290995b563SAxel Dörfler BeMail(TM), Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks 300995b563SAxel Dörfler of Be Incorporated in the United States and other countries. Other brand product 310995b563SAxel Dörfler names are registered trademarks or trademarks of their respective holders. 320995b563SAxel Dörfler All rights reserved. 330995b563SAxel Dörfler */ 340995b563SAxel Dörfler #ifndef _WORDS_H 350995b563SAxel Dörfler #define _WORDS_H 360995b563SAxel Dörfler 37*b79f1647SJonas Sundström 38*b79f1647SJonas Sundström #include <List.h> 390995b563SAxel Dörfler #include <String.h> 400995b563SAxel Dörfler 410995b563SAxel Dörfler #include "WIndex.h" 420995b563SAxel Dörfler 43*b79f1647SJonas Sundström 440995b563SAxel Dörfler typedef enum { 450995b563SAxel Dörfler COMPARE, 460995b563SAxel Dörfler GENERATE 470995b563SAxel Dörfler } metaphlag; 480995b563SAxel Dörfler 490995b563SAxel Dörfler 500995b563SAxel Dörfler bool metaphone(const char* Word, char* Metaph, metaphlag Flag); 510995b563SAxel Dörfler int word_match(const char* reference, const char* test); 520995b563SAxel Dörfler int32 suffix_word(char* dst, const char* src, char flag); 530995b563SAxel Dörfler void sort_word_list(BList* matches, const char* reference); 540995b563SAxel Dörfler 55*b79f1647SJonas Sundström 560995b563SAxel Dörfler class Words : public WIndex { 570995b563SAxel Dörfler public: 580995b563SAxel Dörfler Words(bool useMetaphone = true); 590995b563SAxel Dörfler Words(BPositionIO* thes, bool useMetaphone = true); 60*b79f1647SJonas Sundström Words(const char* dataPath, const char* indexPath, 61*b79f1647SJonas Sundström bool useMetaphone); 620995b563SAxel Dörfler virtual ~Words(void); 630995b563SAxel Dörfler 640995b563SAxel Dörfler virtual status_t BuildIndex(void); 650995b563SAxel Dörfler virtual int32 GetKey(const char* s); 660995b563SAxel Dörfler 670995b563SAxel Dörfler int32 FindBestMatches(BList* matches, const char* word); 680995b563SAxel Dörfler 690995b563SAxel Dörfler protected: 700995b563SAxel Dörfler bool fUseMetaphone; 710995b563SAxel Dörfler }; 720995b563SAxel Dörfler 730995b563SAxel Dörfler #endif // #ifndef _WORDS_H 74d7461887SJonas Sundström 75