Class new title: ClassOrganizer subclassof: Object fields: 'globalComment commentVector groupVector' declare: 'default ' asParagraph | t1 t2 [t1 _ Stream default. t1 print: self globalComment. for t2 to: commentVector length do [t1 cr. t1 print: ((commentVector  t2) inVector concat: groupVector  t2)]. t1 contents asParagraph] asStream | t1 t2 [t1 _ Stream new of: (Vector new: 200). for t2 from: groupVector do [t1 append: t2]. t1 contents asStream] categories [commentVector] category: t1 | t2 [t2 _ commentVector find: t1. t2 = 0  [user notify: 'No such category: ' + t1] groupVector  t2] classInit [default _ 'As yet unclassified'] classify: t1 under: t2 | t3 t4 t5 [t1 is: Vector  [for t3 from: t1 do [self classify: t3 under: t2]] t3 _ commentVector find: t2. t3 > 0 and (groupVector  t3 has: t1)  [self] t4 _ self invert: t1. [t4  [t2 = default  [self] t5 _ commentVector find: t4. groupVector  t5 _ groupVector  t5 delete: t1]]. [t3 = 0  [t3 _ self insert: t2]]. groupVector  t3 _ groupVector  t3 insertSorted: t1. t5 _ commentVector find: default. t5 > 0 and (groupVector  t5) length = 0  [self deleteCategory: t5]] delete: t1 | t2 [for t2 to: groupVector length do [groupVector  t2 has: t1  [groupVector  t2 _ groupVector  t2 delete: t1. (groupVector  t2) length = 0 and commentVector  t2 = default  [self deleteCategory: t2]]]] deleteCategory: t1 [groupVector _ groupVector without: t1. commentVector _ commentVector without: t1] fromParagraph: t1 | t2 t3 t4 t5 [user displayoffwhile [t2 _ t1 asVector. self globalComment_ t2  1. commentVector _ Vector new: t2 length - 1. groupVector _ Vector new: t2 length - 1. for t3 to: t2 length - 1 do [t5 _ t2  (t3 + 1). commentVector  t3 _ t5  1. while [t4 _ t5 find: _. 0 = t4  false] do [t5 _ t5 replace: t4 - 1 to: t4 by: (t5  (t4 - 1) + '_') unique inVector]. groupVector  t3 _ (t5 copy: 2 to: t5 length) sort]. nil]] globalComment [globalComment asParagraph text] globalCommentItself [globalComment] globalComment_ t1 [globalComment _ t1] has: t1 | t2 [for t2 from: groupVector do [t2 has: t1  [true]]. false] init: t1 [self globalComment_ 'This class has not yet been commented'. commentVector _ 'As yet unclassified' inVector. groupVector _ t1 inVector] insert: t1 | t2 t3 t4 [t2 _ commentVector find: default. [t2 > 0  [t3 _ groupVector  t2]]. commentVector _ (commentVector without: t2) , t1. groupVector _ (groupVector without: t2) , (Vector new: 0). t4 _ commentVector length. t2 = 0 or t3 length = 0  [t4] commentVector _ commentVector , default. groupVector _ groupVector , t3. t4] invert: t1 | t2 [for t2 to: groupVector length do [groupVector  t2 has: t1  [commentVector  t2]]. false]