Dieses Repository enthält Python-Dateien die im Rahmen des Wahlpflichtmoduls "Informationssysteme in der Medizintechnik" (Dozent: Prof. Dr. Oliver Hofmann) erstellt wurden und verwaltet deren Versionskontrolle.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

big5prober.py 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ######################## BEGIN LICENSE BLOCK ########################
  2. # The Original Code is Mozilla Communicator client code.
  3. #
  4. # The Initial Developer of the Original Code is
  5. # Netscape Communications Corporation.
  6. # Portions created by the Initial Developer are Copyright (C) 1998
  7. # the Initial Developer. All Rights Reserved.
  8. #
  9. # Contributor(s):
  10. # Mark Pilgrim - port to Python
  11. #
  12. # This library is free software; you can redistribute it and/or
  13. # modify it under the terms of the GNU Lesser General Public
  14. # License as published by the Free Software Foundation; either
  15. # version 2.1 of the License, or (at your option) any later version.
  16. #
  17. # This library is distributed in the hope that it will be useful,
  18. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. # Lesser General Public License for more details.
  21. #
  22. # You should have received a copy of the GNU Lesser General Public
  23. # License along with this library; if not, write to the Free Software
  24. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  25. # 02110-1301 USA
  26. ######################### END LICENSE BLOCK #########################
  27. from .mbcharsetprober import MultiByteCharSetProber
  28. from .codingstatemachine import CodingStateMachine
  29. from .chardistribution import Big5DistributionAnalysis
  30. from .mbcssm import BIG5_SM_MODEL
  31. class Big5Prober(MultiByteCharSetProber):
  32. def __init__(self):
  33. super(Big5Prober, self).__init__()
  34. self.coding_sm = CodingStateMachine(BIG5_SM_MODEL)
  35. self.distribution_analyzer = Big5DistributionAnalysis()
  36. self.reset()
  37. @property
  38. def charset_name(self):
  39. return "Big5"
  40. @property
  41. def language(self):
  42. return "Chinese"