[Python-checkins] CVS: python/dist/src/Modules ucnhash.c,1.7,1.8 unicodename_db.h,1.1,1.2 unicodedata_db.h,1.3,1.4

Fredrik Lundh effbot@users.sourceforge.net
Sun, 21 Jan 2001 09:01:33 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv3835/Modules

Modified Files:
	ucnhash.c unicodename_db.h unicodedata_db.h 
Log Message:


forgot to check in the new makeunicodedata.py script


Index: ucnhash.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/ucnhash.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** ucnhash.c	2001/01/19 19:45:02	1.7
--- ucnhash.c	2001/01/21 17:01:31	1.8
***************
*** 12,16 ****
  
  static unsigned long
! gethash(const char *s, int len)
  {
      int i;
--- 12,16 ----
  
  static unsigned long
! gethash(const char *s, int len, int scale)
  {
      int i;
***************
*** 18,25 ****
      unsigned long ix;
      for (i = 0; i < len; i++) {
!         /* magic value 47 was chosen to minimize the number
!            of collisions for the uninames dataset.  see the
!            makeunicodedata script for more background */
!         h = (h * 47) + (unsigned char) toupper(s[i]);
          ix = h & 0xff000000;
          if (ix)
--- 18,22 ----
      unsigned long ix;
      for (i = 0; i < len; i++) {
!         h = (h * scale) + (unsigned char) toupper(s[i]);
          ix = h & 0xff000000;
          if (ix)
***************
*** 41,46 ****
  
      /* get offset into phrasebook */
!     offset = phrasebook_offset1[(code>>SHIFT)];
!     offset = phrasebook_offset2[(offset<<SHIFT)+(code&((1<<SHIFT)-1))];
      if (!offset)
          return 0;
--- 38,44 ----
  
      /* get offset into phrasebook */
!     offset = phrasebook_offset1[(code>>phrasebook_shift)];
!     offset = phrasebook_offset2[(offset<<phrasebook_shift)+
!                                (code&((1<<phrasebook_shift)-1))];
      if (!offset)
          return 0;
***************
*** 100,104 ****
  {
      unsigned int h, v;
!     unsigned int mask = CODE_SIZE-1;
      unsigned int i, incr;
  
--- 98,102 ----
  {
      unsigned int h, v;
!     unsigned int mask = code_size-1;
      unsigned int i, incr;
  
***************
*** 107,111 ****
         details */
  
!     h = (unsigned int) gethash(name, namelen);
      i = (~h) & mask;
      v = code_hash[i];
--- 105,109 ----
         details */
  
!     h = (unsigned int) gethash(name, namelen, code_magic);
      i = (~h) & mask;
      v = code_hash[i];
***************
*** 130,134 ****
          incr = incr << 1;
          if (incr > mask)
!             incr = incr ^ CODE_POLY;
      }
  }
--- 128,132 ----
          incr = incr << 1;
          if (incr > mask)
!             incr = incr ^ code_poly;
      }
  }

Index: unicodename_db.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/unicodename_db.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** unicodename_db.h	2001/01/19 11:52:33	1.1
--- unicodename_db.h	2001/01/21 17:01:31	1.2
***************
*** 1,8362 ****
! /* generated by maketable.py 0.5 from etc/UnicodeData-Latest.txt */
  
  #define NAME_MAXLEN 256
  
! static unsigned char lexicon[] = {76, 69, 84, 84, 69, 210, 87, 73, 84,
! 200, 83, 89, 76, 76, 65, 66, 76, 197, 89, 201, 83, 77, 65, 76, 204,
! 65, 82, 65, 66, 73, 195, 76, 65, 84, 73, 206, 67, 65, 80, 73, 84, 65,
! 204, 70, 79, 82, 77, 128, 67, 65, 78, 65, 68, 73, 65, 206, 83, 89, 76,
! 76, 65, 66, 73, 67, 211, 76, 73, 71, 65, 84, 85, 82, 197, 72, 65, 78,
! 71, 85, 204, 67, 74, 203, 65, 78, 196, 82, 65, 68, 73, 67, 65, 204,
[...16354 lines suppressed...]
!     6022, 0, 10005, 12329, 41333, 0, 43, 1942, 0, 0, 41107, 12619, 41121, 
!     3885, 92, 64023, 64022, 64021, 64020, 0, 12451, 64025, 41412, 41485, 
!     12035, 0, 6254, 64019, 64018, 8890, 12457, 0, 0, 0, 64778, 0, 0, 0, 0, 0, 
!     7995, 8759, 41411, 13094, 12449, 8546, 41414, 65109, 3179, 0, 4720, 
!     10165, 0, 0, 0, 0, 0, 12915, 0, 0, 0, 0, 0, 6168, 64031, 1946, 294, 
!     41874, 5494, 4639, 0, 12040, 6196, 4498, 0, 64028, 64027, 41789, 41788, 
!     2960, 0, 0, 8969, 0, 0, 0, 0, 2950, 11998, 6210, 0, 370, 3549, 64790, 
!     7801, 4953, 0, 0, 0, 3297, 0, 0, 1135, 0, 0, 5063, 3517, 2964, 0, 0, 
!     2552, 41546, 60, 0, 8649, 8252, 729, 0, 0, 0, 0, 64923, 64710, 41547, 
!     9032, 0, 0, 0, 0, 0, 0, 12832, 0, 8081, 3761, 3537, 0, 9706, 0, 8999, 0, 
!     3850, 3466, 4327, 0, 9373, 0, 908, 6282, 8611, 9813, 0, 41655, 537, 0, 
!     4179, 8978, 0, 0, 1842, 0, 0, 0, 3848, 12081, 9826, 64502, 1767, 5336, 0, 
!     0, 663, 0, 0, 0, 13108, 0, 0, 0, 0, 347, 42112, 40992, 4100, 920, 1811, 
!     1355, 7739, 0, 3592, 10078, 5318, 0, 0, 0, 0, 6224, 0, 9381, 0, 0, 0, 
!     9281, 3296, 12865, 0, 0, 
! };
  
! #define code_magic 47
! #define code_size 16384
! #define code_poly 16427

Index: unicodedata_db.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata_db.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** unicodedata_db.h	2000/11/03 20:24:15	1.3
--- unicodedata_db.h	2001/01/21 17:01:31	1.4
***************
*** 1,3 ****
! /* this file was generated by tools\unicode\makeunicodedata.py 1.1 */
  
  /* a list of unique database records */
--- 1,3 ----
! /* this file was generated by tools\unicode\makeunicodedata.py 2.1 */
  
  /* a list of unique database records */