LanguageDetector class in the file detect_language.py is split into three parts according to its methods, then we apply the Bridge design pattern to reorganize the function structure and main() method to instantiate the object and output our customized result.
Benefits: Decouple the abstraction and implementation parts. The implementation is also changed dynamically at run time and the extensibility of abstraction and implementation is improved. If we want to change the detecting marks or change the output format we can modify those classes directly.
LanguageDetector class in the file detect_language.py is split into three parts according to its methods, then we apply the Bridge design pattern to reorganize the function structure and main() method to instantiate the object and output our customized result. Benefits: Decouple the abstraction and implementation parts. The implementation is also changed dynamically at run time and the extensibility of abstraction and implementation is improved. If we want to change the detecting marks or change the output format we can modify those classes directly.