[squeak-dev] The Trunk: Multilingual-nice.120.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 11 20:22:51 UTC 2010


Nicolas Cellier uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-nice.120.mcz

==================== Summary ====================

Name: Multilingual-nice.120
Author: nice
Time: 11 June 2010, 10:22:16.414 pm
UUID: 72090c02-6d02-2948-b919-965751b913dd
Ancestors: Multilingual-ar.119

Use nextLine to handle any case of in image LF leakage

=============== Diff against Multilingual-ar.119 ===============

Item was changed:
  ----- Method: Unicode class>>parseUnicodeDataFrom: (in category 'class methods') -----
  parseUnicodeDataFrom: stream
  "
  	self halt.
  	self parseUnicodeDataFile
  "
  
  	| line fieldEnd point fieldStart toNumber generalCategory decimalProperty |
  
  	toNumber := [:quad | ('16r', quad) asNumber].
  
  	GeneralCategory := SparseLargeTable new: 16rE0080 chunkSize: 1024 arrayClass: Array base: 1 defaultValue:  'Cn'.
  	DecimalProperty := SparseLargeTable new: 16rE0080 chunkSize: 32 arrayClass: Array base: 1 defaultValue: -1.
  
  	16r3400 to: 16r4DB5 do: [:i | GeneralCategory at: i+1 put: 'Lo'].
  	16r4E00 to: 16r9FA5 do: [:i | GeneralCategory at: i+1 put: 'Lo'].
  	16rAC00 to: 16rD7FF do: [:i | GeneralCategory at: i+1 put: 'Lo'].
  
+ 	[(line := stream nextLine) size > 0] whileTrue: [
- 	[(line := stream upTo: Character cr) size > 0] whileTrue: [
  		fieldEnd := line indexOf: $; startingAt: 1.
  		point := toNumber value: (line copyFrom: 1 to: fieldEnd - 1).
  		point > 16rE007F ifTrue: [
  			GeneralCategory zapDefaultOnlyEntries.
  			DecimalProperty zapDefaultOnlyEntries.
  			^ self].
  		2 to: 3 do: [:i |
  			fieldStart := fieldEnd + 1.
  			fieldEnd := line indexOf: $; startingAt: fieldStart.
  		].
  		generalCategory := line copyFrom: fieldStart to: fieldEnd - 1.
  		GeneralCategory at: point+1 put: generalCategory.
  		generalCategory = 'Nd' ifTrue: [
  			4 to: 7 do: [:i |
  				fieldStart := fieldEnd + 1.
  				fieldEnd := line indexOf: $; startingAt: fieldStart.
  			].
  			decimalProperty :=  line copyFrom: fieldStart to: fieldEnd - 1.
  			DecimalProperty at: point+1 put: decimalProperty asNumber.
  		].
  	].
  	GeneralCategory zapDefaultOnlyEntries.
  	DecimalProperty zapDefaultOnlyEntries.
  !

Item was changed:
  ----- Method: CombinedChar class>>parseCompositionMappingFrom: (in category 'as yet unclassified') -----
  parseCompositionMappingFrom: stream
  "
  	self halt.
  	self parseCompositionMapping
  "
  
  	| line fieldEnd point fieldStart compositions toNumber diacritical result |
  
  	toNumber := [:quad | ('16r', quad) asNumber].
  
  	Compositions := IdentityDictionary new: 2048.
  	Decompositions := IdentityDictionary new: 2048.
  	Diacriticals := IdentitySet new: 2048.
  
+ 	[(line := stream nextLine) size > 0] whileTrue: [
- 	[(line := stream upTo: Character cr) size > 0] whileTrue: [
  		fieldEnd := line indexOf: $; startingAt: 1.
  		point := ('16r', (line copyFrom: 1 to: fieldEnd - 1)) asNumber.
  		2 to: 6 do: [:i |
  			fieldStart := fieldEnd + 1.
  			fieldEnd := line indexOf: $; startingAt: fieldStart.
  		].
  		compositions := line copyFrom: fieldStart to: fieldEnd - 1.
  		(compositions size > 0 and: [compositions first ~= $<]) ifTrue: [
  			compositions := compositions substrings collect: toNumber.
  			compositions size > 1 ifTrue: [
  				diacritical := compositions first.
  				Diacriticals add: diacritical.
  				result := compositions second.
  				(Decompositions includesKey: point) ifTrue: [
  					self error: 'should not happen'.
  				] ifFalse: [
  					Decompositions at: point put: (Array with: diacritical with: result).
  				].
  				(Compositions includesKey: diacritical) ifTrue: [
  					(Compositions at: diacritical) at: result put: point.
  				] ifFalse: [
  					Compositions at: diacritical
  						put: (IdentityDictionary new at: result put: point; yourself).
  				].
  			].
  		].
  	].
  !




More information about the Squeak-dev mailing list