[sword-cvs] icu-sword/source/samples/translit Makefile,1.3,1.4 README.TXT,1.2,1.3 main.cpp,1.2,1.3 translit.dsp,1.3,1.4 translit.dsw,1.2,1.3 translit.sln,NONE,1.1 translit.vcproj,NONE,1.1 unaccent.cpp,NONE,1.1 unaccent.h,NONE,1.1 util.cpp,1.2,1.3 util.h,1.2,1.3
sword@www.crosswire.org
sword@www.crosswire.org
Tue, 9 Sep 2003 19:43:06 -0700
- Previous message: [sword-cvs] icu-sword/source/samples/ustring Makefile,1.3,1.4 readme.txt,NONE,1.1 ustring.cpp,1.2,1.3 ustring.dsp,1.3,1.4 ustring.dsw,1.2,1.3 ustring.sln,NONE,1.1 ustring.vcproj,NONE,1.1
- Next message: [sword-cvs] icu-sword/source/samples/ufortune Makefile,1.2,1.3 fortunedefs.mk,NONE,1.1 readme.txt,1.2,1.3 ufortune.c,1.2,1.3 ufortune.dsp,1.2,1.3 ufortune.dsw,1.2,1.3 ufortune.sln,NONE,1.1 ufortune.vcproj,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/local/cvsroot/icu-sword/source/samples/translit
In directory www:/tmp/cvs-serv19862/source/samples/translit
Added Files:
Makefile README.TXT main.cpp translit.dsp translit.dsw
translit.sln translit.vcproj unaccent.cpp unaccent.h util.cpp
util.h
Log Message:
ICU 2.6 commit
--- NEW FILE: translit.sln ---
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translit", "translit.vcproj", "{D1BEC124-303A-4F44-BA70-55769B8FE96A}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{D1BEC124-303A-4F44-BA70-55769B8FE96A}.Debug.ActiveCfg = Debug|Win32
{D1BEC124-303A-4F44-BA70-55769B8FE96A}.Debug.Build.0 = Debug|Win32
{D1BEC124-303A-4F44-BA70-55769B8FE96A}.Release.ActiveCfg = Release|Win32
{D1BEC124-303A-4F44-BA70-55769B8FE96A}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
--- NEW FILE: translit.vcproj ---
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="translit"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="..\..\..\include"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/translit.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="icuucd.lib icuind.lib"
OutputFile=".\Debug/translit.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/translit.pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/translit.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
OptimizeForProcessor="2"
AdditionalIncludeDirectories="..\..\..\include"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/translit.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="icuuc.lib icuin.lib"
OutputFile=".\Release/translit.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\..\..\lib"
ProgramDatabaseFile=".\Release/translit.pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/translit.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\main.cpp">
</File>
<File
RelativePath=".\unaccent.cpp">
</File>
<File
RelativePath=".\util.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath=".\unaccent.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
--- NEW FILE: unaccent.cpp ---
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1999-2003, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include "unaccent.h"
const char UnaccentTransliterator::fgClassID = 0;
/**
* Constructor
*/
UnaccentTransliterator::UnaccentTransliterator() :
normalizer("", UNORM_NFD),
Transliterator("Unaccent", 0) {
}
/**
* Destructor
*/
UnaccentTransliterator::~UnaccentTransliterator() {
}
/**
* Remove accents from a character using Normalizer.
*/
UChar UnaccentTransliterator::unaccent(UChar c) const {
UnicodeString str(c);
UErrorCode status = U_ZERO_ERROR;
UnaccentTransliterator* t = (UnaccentTransliterator*)this;
t->normalizer.setText(str, status);
if (U_FAILURE(status)) {
return c;
}
return (UChar) t->normalizer.next();
}
/**
* Implement Transliterator API
*/
void UnaccentTransliterator::handleTransliterate(Replaceable& text,
UTransPosition& index,
UBool incremental) const {
UnicodeString str("a");
while (index.start < index.limit) {
UChar c = text.charAt(index.start);
UChar d = unaccent(c);
if (c != d) {
str.setCharAt(0, d);
text.handleReplaceBetween(index.start, index.start+1, str);
}
index.start++;
}
}
--- NEW FILE: unaccent.h ---
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1999-2003, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
#include "unicode/translit.h"
#include "unicode/normlzr.h"
class UnaccentTransliterator : public Transliterator {
public:
/**
* Constructor
*/
UnaccentTransliterator();
/**
* Destructor
*/
virtual ~UnaccentTransliterator();
protected:
/**
* Implement Transliterator API
*/
virtual void handleTransliterate(Replaceable& text,
UTransPosition& index,
UBool incremental) const;
private:
/**
* Unaccent a single character using normalizer.
*/
UChar unaccent(UChar c) const;
Normalizer normalizer;
public:
/**
* Return the class ID for this class. This is useful only for
* comparing to a return value from getDynamicClassID(). For example:
* <pre>
* . Base* polymorphic_pointer = createPolymorphicObject();
* . if (polymorphic_pointer->getDynamicClassID() ==
* . Derived::getStaticClassID()) ...
* </pre>
* @return The class ID for all objects of this class.
* @stable ICU 2.0
*/
static inline UClassID getStaticClassID(void) { return (UClassID)&fgClassID; };
/**
* Returns a unique class ID <b>polymorphically</b>. This method
* is to implement a simple version of RTTI, since not all C++
* compilers support genuine RTTI. Polymorphic operator==() and
* clone() methods call this method.
*
* <p>Concrete subclasses of Transliterator that wish clients to
* be able to identify them should implement getDynamicClassID()
* and also a static method and data member:
*
* <pre>
* static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
* static char fgClassID;
* </pre>
*
* Subclasses that do not implement this method will have a
* dynamic class ID of Transliterator::getStatisClassID().
*
* @return The class ID for this object. All objects of a given
* class have the same class ID. Objects of other classes have
* different class IDs.
* @stable ICU 2.0
*/
virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); };
private:
/**
* Class identifier for subclasses of Transliterator that do not
* define their class (anonymous subclasses).
*/
static const char fgClassID;
};
- Previous message: [sword-cvs] icu-sword/source/samples/ustring Makefile,1.3,1.4 readme.txt,NONE,1.1 ustring.cpp,1.2,1.3 ustring.dsp,1.3,1.4 ustring.dsw,1.2,1.3 ustring.sln,NONE,1.1 ustring.vcproj,NONE,1.1
- Next message: [sword-cvs] icu-sword/source/samples/ufortune Makefile,1.2,1.3 fortunedefs.mk,NONE,1.1 readme.txt,1.2,1.3 ufortune.c,1.2,1.3 ufortune.dsp,1.2,1.3 ufortune.dsw,1.2,1.3 ufortune.sln,NONE,1.1 ufortune.vcproj,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]