PgsFile 0.2.6__py3-none-any.whl → 0.2.8__py3-none-any.whl

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.

Potentially problematic release.


This version of PgsFile might be problematic. Click here for more details.

@@ -0,0 +1,34 @@
1
+ LLM Prompt for Metaphor Analysis
2
+ Task:
3
+ Identify all metaphorical expressions in the provided text using MIP (Metaphor Identification Procedure).
4
+ Categorize each metaphor into one of the following CDA sub-types (with brief justification).
5
+
6
+ Metaphor Categories:
7
+ Structural Metaphor (Abstract → Concrete, e.g., "Time is money" → "You’re wasting my time").
8
+ War/Conflict Metaphor (e.g., "Trade war", "Fight poverty").
9
+ Journey/Movement Metaphor (e.g., "Path to success", "Political U-turn").
10
+ Health/Illness Metaphor (e.g., "Sick economy", "Social contagion").
11
+ Natural Disaster Metaphor (e.g., "Wave of protests", "Financial tsunami").
12
+ Machine/Tool Metaphor (e.g., "Government machinery", "Cogs in the system").
13
+ Container Metaphor (e.g., "Full borders", "Out of the closet").
14
+
15
+ Instructions:
16
+ For each metaphor:
17
+ Quote the exact phrase.
18
+ Explain why it’s metaphorical (contrast literal vs. contextual meaning).
19
+ Assign a category (e.g., "Health/Illness Metaphor").
20
+ Finally, summarize frequencies (e.g., "War Metaphor: 5 instances").
21
+
22
+ Example Output:
23
+ {"meta_id": 1, "Category": "Health/Illness Metaphor",
24
+ "phrase": "The economy is *collapsing*.",
25
+ "metaphorical_term": "collapsing",
26
+ "explanation": '"Collapsing" literally refers to physical structures (e.g., buildings), but here metaphorically describes an abstract system (economy). '}
27
+ {"meta_id": 2, "Category": "War/Conflict Metaphor",
28
+ "phrase": "We must *battle* inflation.",
29
+ "metaphorical_term": "battle",
30
+ "explanation": '"Battle" literally means armed conflict, but here frames inflation as an enemy.'
31
+
32
+
33
+ Text to Analyze:
34
+ [Insert your discourse here]
@@ -0,0 +1,65 @@
1
+ **Example Input:**
2
+ The target word is "bank".
3
+ ```python
4
+ sentences = [
5
+ "I need to go to the bank to deposit my paycheck.",
6
+ "We sat on the bank of the river and enjoyed the view.",
7
+ "You can always bank on her support.",
8
+ "I'm banking on you to finish the project on time.",
9
+ "A bank of clouds was gathering in the sky.",
10
+ "The plane trees formed a bank along the avenue.",
11
+ "The road was on a steep bank.",
12
+ "I banked the money in my savings account.",
13
+ "The pilot banked the plane to the left.",
14
+ "A data bank."
15
+ ]
16
+ ```
17
+
18
+ **Example Output:**
19
+ ```json
20
+ {
21
+ "Meanings Count": 7,
22
+ "Details": {
23
+ "1. Financial Institution": [
24
+ "I need to go to the bank to deposit my paycheck.",
25
+ "I banked the money in my savings account."
26
+ ],
27
+ "2. River Edge": [
28
+ "We sat on the bank of the river and enjoyed the view."
29
+ ],
30
+ "3. Rely or Count On": [
31
+ "You can always bank on her support.",
32
+ "I'm banking on you to finish the project on time."
33
+ ],
34
+ "4. Collection or Mass": [
35
+ "A bank of clouds was gathering in the sky.",
36
+ "The plane trees formed a bank along the avenue."
37
+ ],
38
+ "5. Slope or Hill": [
39
+ "The road was on a steep bank."
40
+ ],
41
+ "6. Tilting an Airplane": [
42
+ "The pilot banked the plane to the left."
43
+ ],
44
+ "7. Storage or Repository": [
45
+ "A data bank."
46
+ ]
47
+ }
48
+ }
49
+ ```
50
+
51
+ **Task:** Categorize Sentences Based on the Meaning of the Target Word
52
+
53
+ You will be given a list of sentences. Your task is to categorize each sentence based on the different meanings of the target word. The output should be a JSON dictionary where the keys are the types of meanings, which are unique, and the values are lists of sentences that correspond to each meaning.
54
+
55
+ **Instructions:**
56
+ 1. Read each sentence carefully.
57
+ 2. Determine the meaning of the target word in the sentence.
58
+ 3. Categorize the sentence under the appropriate meaning.
59
+ 4. Ensure the meanings are unique and label them clearly with Arabic numbers.
60
+ 5. The "Meanings Count" should reflect the number of unique meanings found in the "Details" section.
61
+ 6. The output JSON should follow the same format as the example output provided.
62
+
63
+ **Real Input:**
64
+ 1. Target Word: [Insert Target Word Here]
65
+ 2. Sentences: [Insert List of Sentences Here]
@@ -0,0 +1,41 @@
1
+ Metadata-Version: 2.1
2
+ Name: PgsFile
3
+ Version: 0.2.8
4
+ Summary: This module simplifies Python package management, script execution, file handling, web scraping, and multimedia downloads. The module supports LLM-based NLP tasks such as tokenization, lemmatization, POS tagging, NER, dependency parsing, MDD, WSD, and MIP analysis. It also generates word lists and plots data, aiding literary students. Ideal for scraping data, cleaning text, and analyzing language, it offers user-friendly tools to streamline workflows.
5
+ Home-page: https://mp.weixin.qq.com/s/12-KVLfaPszoZkCxuRd-nQ?token=1589547443&lang=zh_CN
6
+ Author: Pan Guisheng
7
+ Author-email: 895284504@qq.com
8
+ License: Educational free
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: Free For Educational Use
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: chardet
16
+ Requires-Dist: pandas
17
+ Requires-Dist: python-docx
18
+ Requires-Dist: pip
19
+ Requires-Dist: requests
20
+ Requires-Dist: fake-useragent
21
+ Requires-Dist: lxml
22
+ Requires-Dist: pimht
23
+ Requires-Dist: pysbd
24
+ Requires-Dist: nlpir-python
25
+ Requires-Dist: pillow
26
+
27
+ Purpose: This module is designed to make complex tasks accessible and convenient, even for beginners. By providing a unified set of tools, it simplifies the workflow for data collection, processing, and analysis. Whether you're scraping data from the web, cleaning text, or performing LLM-based NLP tasks, this module ensures you can focus on your research without getting bogged down by technical challenges.
28
+
29
+ Key Features:
30
+ 1. **Web Scraping:** Easily scrape data from websites and download multimedia content.
31
+ 2. **Package Management:** Install, uninstall, and manage Python packages with simple commands.
32
+ 3. **Data Retrieval:** Extract data from various file formats like text, JSON, TSV, Excel, and HTML (both online and offline).
33
+ 4. **Data Storage:** Write and append data to text files, Excel, JSON, and JSON lines.
34
+ 5. **File and Folder Processing:** Manage file paths, create directories, move or copy files, and search for files with specific keywords.
35
+ 6. **Data Cleaning:** Clean text, handle punctuation, remove stopwords, and prepare data for analysis, utilizing valuable corpora and dictionaries such as CET-4/6 vocabulary and BNC-COCA word lists.
36
+ 7. **NLP:** Perform word tokenization, lemmatization, POS tagging, NER, dependency parsing, MDD, WSD, and MIP analysis using prepared LLM prompts.
37
+ 8. **Math Operations:** Format numbers, convert decimals to percentages, and validate data.
38
+ 9. **Visualization:** Process images (e.g., make white pixels transparent) and manage fonts for rendering text.
39
+
40
+ Author: Pan Guisheng, a PhD student at the Graduate Institute of Interpretation and Translation of Shanghai International Studies University
41
+ Email: 895284504@qq.com
@@ -1,5 +1,5 @@
1
- PgsFile/PgsFile.py,sha256=x_oMaOASc-QozshnTr3u-JMWppGWLDrGWy4LXzmcpOA,104813
2
- PgsFile/__init__.py,sha256=eduFbjUeZk2f4nUU3B-_2SQzHLNMtHrwDEcOveIu_-0,2903
1
+ PgsFile/PgsFile.py,sha256=3XHla96IWKp2D1FzURg3IP3iltaxB8DTab4mqk_bMe8,113828
2
+ PgsFile/__init__.py,sha256=2qD7RMhfaZe3SwxaI44zbyEqRSDiL13vGILThlSAUPE,3204
3
3
  PgsFile/Corpora/Corpora/Parallel/HK Financial and Legal EC Parallel Corpora/HK-Press releases of the Financial Secretary Office (2007-2019).tsv,sha256=IpLGQQY5cXbFWmUPFEdzEPz8CXuCdR2DdZOhBxA7FWw,2035252
4
4
  PgsFile/Corpora/Corpora/Parallel/HK Financial and Legal EC Parallel Corpora/Hong Kong bilingual court decisions (1997-2017).tsv,sha256=BMmPr5eYBIv06Wnfb8nOBrfIzpAl-LLoRk3R60dLxe0,5928126
5
5
  PgsFile/Corpora/Corpora/Parallel/HK Financial and Legal EC Parallel Corpora/HongKong-Legislation.tsv,sha256=PJjiJIKV9aEzE0tAcqRNRCrunyWGiuD3sbkwkD9hoqo,4460018
@@ -2663,14 +2663,19 @@ PgsFile/models/slovene.pickle,sha256=faxlAhKzeHs5mWwBvSCEEVST5vbsOQurYfdnUlsIuOo
2663
2663
  PgsFile/models/spanish.pickle,sha256=Jx3GAnxKrgVvcqm_q1ZFz2fhmL9PlyiVhE5A9ZiczcM,597831
2664
2664
  PgsFile/models/swedish.pickle,sha256=QNUOva1sqodxXy4wCxIX7JLELeIFpUPMSlaQO9LJrPo,1034496
2665
2665
  PgsFile/models/turkish.pickle,sha256=065H12UB0CdpiAnRLnUpLJw5KRBIhUM0KAL5Xbl2XMw,1225013
2666
+ PgsFile/models/dics/BNC_COCA_lists.xlsx,sha256=ua5iQzEf5UQpsCezbsliNF6e_PYHIHGSJUjn9MyEEks,1229313
2667
+ PgsFile/models/dics/CET-4 2016 (6314).txt,sha256=NZ3ai_OqIJJLPTPIs4Mc6170gzBIoC0Jgm4cF3tjMdc,57411
2668
+ PgsFile/models/dics/CET-6 2016 (1726).txt,sha256=6Bk-R_qVxJRNV8McXqK9Q1uoFvpokB1foK9bUpHxRzE,14914
2666
2669
  PgsFile/models/fonts/DejaVuSans.ttf,sha256=faGVp0xVvvmI0NSPlQi9XYSUJcF3Dbpde_xs6e2EiVQ,757076
2667
2670
  PgsFile/models/fonts/书体坊赵九江钢笔行书体.ttf,sha256=fTOv4FFMnYtN1zCZghJ6-P1pzznA5qqoujwpDFY63Ek,3140656
2668
2671
  PgsFile/models/fonts/全新硬笔楷书简.ttf,sha256=mPemGYMpgQxvFL1pFjjnyUMIprHzcoOaw8oeZQ4k1x0,2397296
2669
2672
  PgsFile/models/fonts/全新硬笔行书简.ttf,sha256=bUtbl71eK_ellp1z0tCmmR_P-JhqVFIpzeuRlrEBo9g,2611516
2670
2673
  PgsFile/models/fonts/博洋行书3500.TTF,sha256=VrgeHr8cgOL6JD05QyuD9ZSyw4J2aIVxKxW8zSajq6Q,4410732
2671
2674
  PgsFile/models/fonts/陆柬之行书字体.ttf,sha256=Zpd4Z7E9w-Qy74yklXHk4vM7HOtHuQgllvygxZZ1Hvs,1247288
2672
- PgsFile-0.2.6.dist-info/LICENSE,sha256=cE5c-QToSkG1KTUsU8drQXz1vG0EbJWuU4ybHTRb5SE,1138
2673
- PgsFile-0.2.6.dist-info/METADATA,sha256=-wNhk0T1JpcdoKAQvO4fyQ-1N_UfdJ9HefHNFOERk8I,2711
2674
- PgsFile-0.2.6.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
2675
- PgsFile-0.2.6.dist-info/top_level.txt,sha256=028hCfwhF3UpfD6X0rwtWpXI1RKSTeZ1ALwagWaSmX8,8
2676
- PgsFile-0.2.6.dist-info/RECORD,,
2675
+ PgsFile/models/prompts/1. MIP prompt.txt,sha256=4lHlHmleayRytqr1n9jtt6vn1rQvyf4BKeThpbwI8o8,1638
2676
+ PgsFile/models/prompts/2. WSD prompt.txt,sha256=o-ZFtCRUCDrXgm040WTQch9v2Y_r2SIlrZaquilJjgQ,2348
2677
+ PgsFile-0.2.8.dist-info/LICENSE,sha256=cE5c-QToSkG1KTUsU8drQXz1vG0EbJWuU4ybHTRb5SE,1138
2678
+ PgsFile-0.2.8.dist-info/METADATA,sha256=IkTDPMbQEZLsmNBQ4h7ywCM8G2LpVSHtiqcWUjshGfI,2887
2679
+ PgsFile-0.2.8.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
2680
+ PgsFile-0.2.8.dist-info/top_level.txt,sha256=028hCfwhF3UpfD6X0rwtWpXI1RKSTeZ1ALwagWaSmX8,8
2681
+ PgsFile-0.2.8.dist-info/RECORD,,
@@ -1,41 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: PgsFile
3
- Version: 0.2.6
4
- Summary: This module streamlines Python package management, script execution, file handling, web scraping, multimedia downloads, data cleaning, and NLP tasks such as word tokenization and POS tagging. It also assists with generating word lists and plotting data, making these tasks more accessible and convenient for literary students. Whether you need to scrape data from websites, clean text, or analyze language, this module provides user-friendly tools to simplify your workflow.
5
- Home-page: https://mp.weixin.qq.com/s/12-KVLfaPszoZkCxuRd-nQ?token=1589547443&lang=zh_CN
6
- Author: Pan Guisheng
7
- Author-email: 895284504@qq.com
8
- License: Educational free
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: Free For Educational Use
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.8
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
- Requires-Dist: chardet
16
- Requires-Dist: pandas
17
- Requires-Dist: python-docx
18
- Requires-Dist: pip
19
- Requires-Dist: requests
20
- Requires-Dist: fake-useragent
21
- Requires-Dist: lxml
22
- Requires-Dist: pimht
23
- Requires-Dist: pysbd
24
- Requires-Dist: nlpir-python
25
- Requires-Dist: pillow
26
-
27
- Purpose: This module is designed to make complex tasks accessible and convenient, even for beginners. By providing a unified set of tools, it simplifies the workflow for data collection, processing, and analysis. Whether you're scraping data from the web, cleaning text, or performing NLP tasks, this module ensures you can focus on your research without getting bogged down by technical challenges.
28
-
29
- Key Features:
30
- 1. Web Scraping: Easily scrape data from websites and download multimedia content.
31
- 2. Package Management: Install, uninstall, and manage Python packages with simple commands.
32
- 3. Data Retrieval: Extract data from various file formats like text, JSON, TSV, Excel, and HTML (both online and offline).
33
- 4. Data Storage: Write and append data to text files, Excel, JSON, and JSON lines.
34
- 5. File and Folder Processing: Manage file paths, create directories, move or copy files, and search for files with specific keywords.
35
- 6. Data Cleaning: Clean text, handle punctuation, remove stopwords, and prepare data for analysis.
36
- 7. NLP: Perform tokenization, generate n-grams, and create word lists for text analysis.
37
- 8. Math Operations: Format numbers, convert decimals to percentages, and validate data.
38
- 9. Visualization: Process images (e.g., make white pixels transparent) and manage fonts for rendering text.
39
-
40
- Author: Pan Guisheng, a PhD student at the Graduate Institute of Interpretation and Translation of Shanghai International Studies University
41
- E-mail: 895284504@qq.com