<s> from ... . datasources . meta import frequencies , mappers <EOL> from ... . dependencies import DependentSet <EOL> class Revision ( DependentSet ) : <EOL> def __init__ ( self , name , stem_word , wikitext_revision ) : <EOL> super ( ) . __init__ ( name ) <EOL> self . stems = mappers . map ( <EOL> stem_word , wikitext_revision . words , <EOL> name = name + "<STR_LIT>" <EOL> ) <EOL> self . stem_frequency = frequencies . table ( <EOL> self . stems , <EOL> name = name + "<STR_LIT>" <EOL> ) <EOL> if hasattr ( wikitext_revision , '<STR_LIT>' ) : <EOL> self . parent = Revision ( name + "<STR_LIT>" , stem_word , <EOL> wikitext_revision . parent ) <EOL> if hasattr ( wikitext_revision , '<STR_LIT>' ) : <EOL> self . diff = Diff ( name + "<STR_LIT>" , stem_word , <EOL> wikitext_revision . diff , self ) <EOL> class Diff ( DependentSet ) : <EOL> def __init__ ( self , name , stem_word , wikitext_diff , revision ) : <EOL> super ( ) . __init__ ( name ) <EOL> self . stems_added = mappers . map ( <EOL> stem_word , wikitext_diff . words_added , <EOL> name = name + "<STR_LIT>" <EOL> ) <EOL> self . stems_removed = mappers . map ( <EOL> stem_word , wikitext_diff . words_removed , <EOL> name = name + "<STR_LIT>" <EOL> ) <EOL> self . stem_delta = frequencies . delta ( <EOL> revision . parent . stem_frequency , <EOL> revision . stem_frequency , <EOL> name = name + "<STR_LIT>" <EOL> ) <EOL> self . stem_prop_delta = frequencies . prop_delta ( <EOL> revision . parent . stem_frequency , self . stem_delta , <EOL> name = name + "<STR_LIT>" <EOL> ) </s>
