LangSC 2.0.0__tar.gz → 2.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {langsc-2.0.0 → langsc-2.0.2}/LangSC/__version__.py +1 -1
  2. {langsc-2.0.0 → langsc-2.0.2}/LangSC/bcc.py +27 -1
  3. langsc-2.0.2/LangSC/bcclib.dll +0 -0
  4. langsc-2.0.2/LangSC/libbcclib.so +0 -0
  5. {langsc-2.0.0 → langsc-2.0.2}/LangSC.egg-info/PKG-INFO +1 -1
  6. {langsc-2.0.0 → langsc-2.0.2}/LangSC.egg-info/SOURCES.txt +0 -1
  7. {langsc-2.0.0 → langsc-2.0.2}/PKG-INFO +1 -1
  8. {langsc-2.0.0 → langsc-2.0.2}/setup.cfg +1 -1
  9. langsc-2.0.0/LangSC/BCC0.py +0 -4
  10. langsc-2.0.0/LangSC/bcclib.dll +0 -0
  11. langsc-2.0.0/LangSC/libbcclib.so +0 -0
  12. {langsc-2.0.0 → langsc-2.0.2}/LICENSE +0 -0
  13. {langsc-2.0.0 → langsc-2.0.2}/LangSC/BCCconfig.txt +0 -0
  14. {langsc-2.0.0 → langsc-2.0.2}/LangSC/GPFconfig.txt +0 -0
  15. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/Pathplan.dll +0 -0
  16. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/cdt.dll +0 -0
  17. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/cgraph.dll +0 -0
  18. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/config6 +0 -0
  19. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/dot.exe +0 -0
  20. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/fontconfig.dll +0 -0
  21. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/fontconfig_fix.dll +0 -0
  22. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/freetype6.dll +0 -0
  23. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/gvc.dll +0 -0
  24. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/gvplugin_core.dll +0 -0
  25. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/gvplugin_dot_layout.dll +0 -0
  26. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/gvplugin_gd.dll +0 -0
  27. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/gvplugin_pango.dll +0 -0
  28. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/iconv.dll +0 -0
  29. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/intl.dll +0 -0
  30. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/jpeg62.dll +0 -0
  31. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libcairo-2.dll +0 -0
  32. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libexpat-1.dll +0 -0
  33. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libexpat.dll +0 -0
  34. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libfontconfig-1.dll +0 -0
  35. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libfreetype-6.dll +0 -0
  36. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libgdk_pixbuf-2.0-0.dll +0 -0
  37. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libglade-2.0-0.dll +0 -0
  38. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libglib-2.0-0.dll +0 -0
  39. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libgmodule-2.0-0.dll +0 -0
  40. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libgobject-2.0-0.dll +0 -0
  41. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libgthread-2.0-0.dll +0 -0
  42. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libgtkglext-win32-1.0-0.dll +0 -0
  43. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libpango-1.0-0.dll +0 -0
  44. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libpangocairo-1.0-0.dll +0 -0
  45. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libpangoft2-1.0-0.dll +0 -0
  46. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libpangowin32-1.0-0.dll +0 -0
  47. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libpng14-14.dll +0 -0
  48. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/librsvg-2-2.dll +0 -0
  49. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/libxml2.dll +0 -0
  50. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/ltdl.dll +0 -0
  51. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Graph/zlib1.dll +0 -0
  52. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Parser.lua +0 -0
  53. {langsc-2.0.0 → langsc-2.0.2}/LangSC/Segment.dat +0 -0
  54. {langsc-2.0.0 → langsc-2.0.2}/LangSC/__init__.py +0 -0
  55. {langsc-2.0.0 → langsc-2.0.2}/LangSC/_utils.py +0 -0
  56. {langsc-2.0.0 → langsc-2.0.2}/LangSC/base.lex +0 -0
  57. {langsc-2.0.0 → langsc-2.0.2}/LangSC/gpf.py +0 -0
  58. {langsc-2.0.0 → langsc-2.0.2}/LangSC/gpflib.dll +0 -0
  59. {langsc-2.0.0 → langsc-2.0.2}/LangSC/idxPOS.dat +0 -0
  60. {langsc-2.0.0 → langsc-2.0.2}/LangSC/jss.py +0 -0
  61. {langsc-2.0.0 → langsc-2.0.2}/LangSC/jsslib.dll +0 -0
  62. {langsc-2.0.0 → langsc-2.0.2}/LangSC/libbcclib.dylib +0 -0
  63. {langsc-2.0.0 → langsc-2.0.2}/LangSC/libgpflib.dylib +0 -0
  64. {langsc-2.0.0 → langsc-2.0.2}/LangSC/libgpflib.so +0 -0
  65. {langsc-2.0.0 → langsc-2.0.2}/LangSC/libjsslib.dylib +0 -0
  66. {langsc-2.0.0 → langsc-2.0.2}/LangSC/libjsslib.so +0 -0
  67. {langsc-2.0.0 → langsc-2.0.2}/LangSC.egg-info/dependency_links.txt +0 -0
  68. {langsc-2.0.0 → langsc-2.0.2}/LangSC.egg-info/not-zip-safe +0 -0
  69. {langsc-2.0.0 → langsc-2.0.2}/LangSC.egg-info/requires.txt +0 -0
  70. {langsc-2.0.0 → langsc-2.0.2}/LangSC.egg-info/top_level.txt +0 -0
  71. {langsc-2.0.0 → langsc-2.0.2}/MANIFEST.in +0 -0
  72. {langsc-2.0.0 → langsc-2.0.2}/README.md +0 -0
  73. {langsc-2.0.0 → langsc-2.0.2}/pyproject.toml +0 -0
  74. {langsc-2.0.0 → langsc-2.0.2}/setup.py +0 -0
@@ -1,3 +1,3 @@
1
- VERSION = (2, 0, 0)
1
+ VERSION = (2, 0, 2)
2
2
 
3
3
  __version__ = '.'.join(map(str, VERSION))
@@ -151,8 +151,33 @@ class BCC:
151
151
  command = Others.get("Command", Others.get("Output", "Freq"))
152
152
  if command == "Context":
153
153
  ret = self._clean_source_id(ret)
154
+ elif command == "Freq":
155
+ ret = self._clean_freq_source(ret)
154
156
  return ret
155
157
 
158
+ def _clean_freq_source(self, ret):
159
+ """Format Source field in Freq results for readability.
160
+
161
+ Replaces \\ with / in paths, and puts each source:count on its own line.
162
+ """
163
+ try:
164
+ data = json.loads(ret)
165
+ if isinstance(data, dict) and "Source" in data:
166
+ source = data["Source"]
167
+ if isinstance(source, dict):
168
+ for key in source:
169
+ val = source[key]
170
+ if isinstance(val, str):
171
+ val = val.replace("\\", "/")
172
+ parts = val.split(" ")
173
+ source[key] = "\n".join(parts)
174
+ ret = json.dumps(data, ensure_ascii=False, indent=2)
175
+ # Make newlines in Source values display as actual line breaks
176
+ ret = ret.replace("\\n", "\n")
177
+ return ret
178
+ except (json.JSONDecodeError, TypeError):
179
+ return ret
180
+
156
181
  def _clean_source_id(self, ret):
157
182
  """Remove SourceID fields from Context results."""
158
183
  try:
@@ -168,7 +193,8 @@ class BCC:
168
193
  for item in v:
169
194
  if isinstance(item, dict):
170
195
  item.pop("SourceID", None)
171
- return json.dumps(data, ensure_ascii=False)
196
+ ret = json.dumps(data, ensure_ascii=False, indent=2)
197
+ return ret.replace("\\\\", "/")
172
198
  except (json.JSONDecodeError, TypeError):
173
199
  return ret
174
200
 
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LangSC
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Language Structure Computation - GPF, BCC, and JSS unified package
5
5
  Author: endongxun
6
6
  Author-email: xunendong@gmail.com
@@ -4,7 +4,6 @@ README.md
4
4
  pyproject.toml
5
5
  setup.cfg
6
6
  setup.py
7
- LangSC/BCC0.py
8
7
  LangSC/BCCconfig.txt
9
8
  LangSC/GPFconfig.txt
10
9
  LangSC/Parser.lua
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LangSC
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Language Structure Computation - GPF, BCC, and JSS unified package
5
5
  Author: endongxun
6
6
  Author-email: xunendong@gmail.com
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = LangSC
3
- version = 2.0.0
3
+ version = 2.0.2
4
4
  description = Language Structure Computation - GPF, BCC, and JSS unified package
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -1,4 +0,0 @@
1
- from LangSC import BCC
2
- g=BCC("largecorpusIdx")
3
- Ret=g.Run("我们",Command="Context")
4
- print(Ret)
Binary file
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes