164339d36f8bd4db5025fe2988eda22b491a9219cFredrik RoubertCopyright (C) 2016 and later: Unicode, Inc. and others. 264339d36f8bd4db5025fe2988eda22b491a9219cFredrik RoubertLicense & terms of use: http://www.unicode.org/copyright.html#License 364339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert 427f654740f2a26ad62a5c155af9199af9e69b889clairehoCopyright (c) 2002-2010, International Business Machines Corporation and others. All Rights Reserved. 5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querubreak: Boundary Analysis 6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruThis sample demonstrates 8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru Using ICU to determine the linguistic boundaries within text 9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruFiles: 12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru break.cpp Main source file in C++ 13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru ubreak.c Main source file in C 14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru break.sln Windows MSVC workspace. Double-click this to get started. 15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru break.vcproj Windows MSVC project file 16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruTo Build break on Windows 18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 1. Install and build ICU 19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 2. In MSVC, open the workspace file icu\samples\break\break.sln 20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 3. Choose a Debug or Release build. 21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 4. Build. 22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruTo Run on Windows 24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 1. Start a command shell window 25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 2. Add ICU's bin directory to the path, e.g. 26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru set PATH=c:\icu\bin;%PATH% 27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru (Use the path to where ever ICU is on your system.) 28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 3. cd into the break directory, e.g. 29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru cd c:\icu\source\samples\break\debug 3027f654740f2a26ad62a5c155af9199af9e69b889claireho 4. Run it (Warning: Be careful, 'break' is also a system command on many systems) 3127f654740f2a26ad62a5c155af9199af9e69b889claireho .\break 32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruTo Build on Unixes 34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 1. Build ICU. 35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru Specify an ICU install directory when running configure, 36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru using the --prefix option. The steps to build ICU will look something 37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru like this: 38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru cd <icu directory>/source 39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru runConfigureICU <platform-name> --prefix <icu install directory> [other options] 40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru gmake all 41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 2. Install ICU, 43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru gmake install 44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 3. Compile 46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru cd <icu directory>/source/samples/break 47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru gmake ICU_PREFIX=<icu install directory) 48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru To Run on Unixes 50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru cd <icu directory>/source/samples/break 51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru gmake ICU_PREFIX=<icu install directory> check 53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru -or- 54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru export LD_LIBRARY_PATH=<icu install directory>/lib:.:$LD_LIBRARY_PATH 56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru break 57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru Note: The name of the LD_LIBRARY_PATH variable is different on some systems. 60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru If in doubt, run the sample using "gmake check", and note the name of 61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru the variable that is used there. LD_LIBRARY_PATH is the correct name 62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru for Linux and Solaris. 63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 64