From a85ab865cb0c3112b81ded87adcae42ab92e43a7 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 13 Sep 2012 19:05:09 -0700 Subject: [PATCH 1/3] up note for new version of DISC --- xwords4/dawg/Catalan/Makefile.DISC2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwords4/dawg/Catalan/Makefile.DISC2 b/xwords4/dawg/Catalan/Makefile.DISC2 index 28bf19bca..0fd8df01b 100644 --- a/xwords4/dawg/Catalan/Makefile.DISC2 +++ b/xwords4/dawg/Catalan/Makefile.DISC2 @@ -20,7 +20,7 @@ LANGCODE=ca_ES TARGET_TYPE ?= WINCE ENC = UTF-8 -DICTNOTE = "Built from DISC 2.0.5.\nSee http://escrable.montane.cat/diccionari for more information." +DICTNOTE = "Built from DISC 2.0.6.\nSee http://escrable.montane.cat/diccionari for more information." ifeq ($(TARGET_TYPE),PALM) From 20afa9fd56e3b1b0eb8955967366f9d11807186c Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 13 Sep 2012 19:06:46 -0700 Subject: [PATCH 2/3] rename: file's obsolete now --- xwords4/dawg/Catalan/{Makefile => Makefile.DANOSC} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename xwords4/dawg/Catalan/{Makefile => Makefile.DANOSC} (100%) diff --git a/xwords4/dawg/Catalan/Makefile b/xwords4/dawg/Catalan/Makefile.DANOSC similarity index 100% rename from xwords4/dawg/Catalan/Makefile rename to xwords4/dawg/Catalan/Makefile.DANOSC From aaa12a291e87caf7d42dc275cef89d8867610a0b Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 13 Sep 2012 19:07:37 -0700 Subject: [PATCH 3/3] use unpack to correctly pull wordcount, note and checksum --- xwords4/dawg/dawg2dict.pl | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/xwords4/dawg/dawg2dict.pl b/xwords4/dawg/dawg2dict.pl index 629131270..e09d3a1ff 100755 --- a/xwords4/dawg/dawg2dict.pl +++ b/xwords4/dawg/dawg2dict.pl @@ -169,17 +169,9 @@ sub readNodesToEnd($) { sub printHeader($$) { my ( $buf, $len ) = @_; printf STDERR "skipped %d bytes of header:\n", $len + 2; - my $asStr = Encode::decode_utf8($buf); - my @strs = split( '\0', $asStr ); - # There are variable numbers of strings showing up in this thing. - # Need to figure out the right way to unpack the thing. - $gDesc = $strs[1]; - $gSum = $strs[2]; - foreach my $str (@strs) { - if ( 0 < length($str) ) { - print STDERR 'Got: ', $str, "\n"; - } - } + my $count; + ($count, $gDesc, $gSum) = unpack( 'N Z* Z*', $buf ); + printf STDERR "has %d words\n", $count; } sub nodeSizeFromFlags($$) {