Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pooja97/Word_Processor

Open more actions menu

Repository files navigation

Flyweight pattern for Word processor in python3

Created a Character class that stores only the unicode code point of the character. A Flyweight factory that given a unicode code point returns the Flyweight character object for the character. A single point of access to the same Flyweight factory from anywhere in the program. (Singleton pattern)

Created a Flyweight factory for fonts. In this factory the input is a triple: the font name (Times, Courier, etc), point size (12, 13, etc) and style (bold, italic, underline, etc). This factory also has a single point of access. (Singleton)

For the Character Flyweight to work we need to a way to story the extrinsic state of the character objects, that is the font information. For this we will use a RunArray. A RunArray keeps track of runs in a sequence.

About

Flyweight pattern for word processor in python3. Implemented a Flyweight factory that given a unicode code point returns the Flyweight character object for the character and font. Created RunArray for tracking character sequence in the word document.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.