You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/09/17 23:36:32 UTC

[lucy-commits] svn commit: r1172071 - in /incubator/lucy/trunk: LICENSE NOTICE core/Lucy/Util/StringHelper.c core/Lucy/Util/StringHelper3.c

Author: marvin
Date: Sat Sep 17 21:36:32 2011
New Revision: 1172071

URL: http://svn.apache.org/viewvc?rev=1172071&view=rev
Log:
Merge StringHelper3.c into StringHelper.c, remove Unicode license.

This file StringHelper3.c, which contains only a single function
StrHelp_is_whitespace(), is currently listed under the Unicode Consortium's
license.  I wrote that file myself, but erring on the side of paranoia, I
credited the Unicode Consortium for having defined the character class.  I now
believe that this was incorrect, and I am not aware of any other projects
that have done likewise.  StrHelp_is_whitespace() implements a function using
the Unicode standard; it is not a modified redistribution of Unicode data
files.

Removed:
    incubator/lucy/trunk/core/Lucy/Util/StringHelper3.c
Modified:
    incubator/lucy/trunk/LICENSE
    incubator/lucy/trunk/NOTICE
    incubator/lucy/trunk/core/Lucy/Util/StringHelper.c

Modified: incubator/lucy/trunk/LICENSE
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/LICENSE?rev=1172071&r1=1172070&r2=1172071&view=diff
==============================================================================
--- incubator/lucy/trunk/LICENSE (original)
+++ incubator/lucy/trunk/LICENSE Sat Sep 17 21:36:32 2011
@@ -201,64 +201,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 
-Some code in core/Lucy/Util/StringHelper3.c was derived using data files
-from the Unicode Consortium under <http://www.unicode.org/Public/>.  Here is
-the license for those materials:
-
-    EXHIBIT 1 UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
-
-    Unicode Data Files include all data files under the directories
-    http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-    http://www.unicode.org/cldr/data/ . Unicode Software includes any source code
-    published in the Unicode Standard or under the directories
-    http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
-    http://www.unicode.org/cldr/data/.
-
-    NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING,
-    INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA
-    FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO
-    BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT
-    AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR
-    SOFTWARE.
-
-    COPYRIGHT AND PERMISSION NOTICE
-
-    Copyright 1991-2010 Unicode, Inc. All rights reserved. Distributed under the
-    Terms of Use in http://www.unicode.org/copyright.html.
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy of
-    the Unicode data files and any associated documentation (the "Data Files") or
-    Unicode software and any associated documentation (the "Software") to deal in
-    the Data Files or Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, and/or sell copies
-    of the Data Files or Software, and to permit persons to whom the Data Files or
-    Software are furnished to do so, provided that (a) the above copyright
-    notice(s) and this permission notice appear with all copies of the Data Files
-    or Software, (b) both the above copyright notice(s) and this permission notice
-    appear in associated documentation, and (c) there is clear notice in each
-    modified Data File or in the Software as well as in the documentation
-    associated with the Data File(s) or Software that the data or software has been
-    modified.
-
-    THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
-    PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
-    THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
-    DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-    OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR
-    SOFTWARE.
-
-    Except as contained in this notice, the name of a copyright holder shall not be
-    used in advertising or otherwise to promote the sale, use or other dealings in
-    these Data Files or Software without prior written authorization of the
-    copyright holder.
-
-    Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be
-    registered in some jurisdictions. All other trademarks and registered
-    trademarks mentioned herein are the property of their respective owners.
-
 Portions of the Snowball stemming library are bundled with this distribution
 under modules/analysis/snowstem and modules/analysis/snowstop.  Here is the
 license for those materials:

Modified: incubator/lucy/trunk/NOTICE
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/NOTICE?rev=1172071&r1=1172070&r2=1172071&view=diff
==============================================================================
--- incubator/lucy/trunk/NOTICE (original)
+++ incubator/lucy/trunk/NOTICE Sat Sep 17 21:36:32 2011
@@ -4,9 +4,6 @@ Copyright 2010-2011 The Apache Software 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-This software contains code derived from Unicode data available from
-<http://www.unicode.org/Public/> and Copyright 1991-2010 Unicode, Inc.
-
 This software bundles code developed by the Snowball project at
 <http://snowball.tartarus.org>, Copyright (c) 2001, Dr Martin Porter and
 Copyright (c) 2002, Richard Boulton.

Modified: incubator/lucy/trunk/core/Lucy/Util/StringHelper.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Util/StringHelper.c?rev=1172071&r1=1172070&r2=1172071&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Util/StringHelper.c (original)
+++ incubator/lucy/trunk/core/Lucy/Util/StringHelper.c Sat Sep 17 21:36:32 2011
@@ -129,6 +129,32 @@ StrHelp_utf8_valid(const char *ptr, size
     return true;
 }
 
+bool_t
+StrHelp_is_whitespace(uint32_t code_point) {
+    switch (code_point) {
+            // <control-0009>..<control-000D>
+        case 0x0009: case 0x000A: case 0x000B: case 0x000C: case 0x000D:
+        case 0x0020: // SPACE
+        case 0x0085: // <control-0085>
+        case 0x00A0: // NO-BREAK SPACE
+        case 0x1680: // OGHAM SPACE MARK
+        case 0x180E: // MONGOLIAN VOWEL SEPARATOR
+            // EN QUAD..HAIR SPACE
+        case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x2004:
+        case 0x2005: case 0x2006: case 0x2007: case 0x2008: case 0x2009:
+        case 0x200A:
+        case 0x2028: // LINE SEPARATOR
+        case 0x2029: // PARAGRAPH SEPARATOR
+        case 0x202F: // NARROW NO-BREAK SPACE
+        case 0x205F: // MEDIUM MATHEMATICAL SPACE
+        case 0x3000: // IDEOGRAPHIC SPACE
+            return true;
+
+        default:
+            return false;
+    }
+}
+
 uint32_t
 StrHelp_encode_utf8_char(uint32_t code_point, void *buffer) {
     uint8_t *buf = (uint8_t*)buffer;