synonym.json

Overview

synonym.json is a JSON file that serves as a comprehensive bilingual mapping dictionary. It primarily provides mutual mappings between Chinese company names and their corresponding stock or company codes. Additionally, it includes mappings of Chinese temporal terms and weekday names to their synonyms or abbreviations. This file functions as a key-value store enabling quick lookup of equivalent terms, facilitating tasks such as data normalization, synonym resolution, and entity recognition in financial or business data processing.

The core utility of this file lies in its bidirectional mappings: every Chinese company name maps to a unique code string, and each code string maps back to the company name. This redundancy allows for efficient conversion between the two representations. Similarly, common Chinese temporal words and weekday names are mapped to their synonyms or abbreviations, supporting natural language processing or user interface localization.

File Content and Structure

Example Entries

{
  "阿为特": "873693",
  "873693": "阿为特",
  "去年": "2024",
  "前年": "2023",
  "今年": "2025",
  "上季度": ["一季度", "q1"],
  "q1": "一季度",
  "周一": ["礼拜一", "星期一"],
  "周日": ["礼拜日", "星期日", "星期天", "礼拜天"],
  "上班": "办公"
}

Detailed Explanation of Content

Company Name and Code Mappings

Temporal Terms and Synonyms

Implementation Details and Algorithms

Interaction with Other Parts of a System or Application

Usage Examples

Example 1: Lookup Company Code by Name

import json

# Load the synonym dictionary
with open("synonym.json", "r", encoding="utf-8") as f:
    synonyms = json.load(f)

company_name = "阿为特"
company_code = synonyms.get(company_name)

print(f"Company code for {company_name} is {company_code}")
# Output: Company code for 阿为特 is 873693

Example 2: Lookup Company Name by Code

code = "873693"
name = synonyms.get(code)

print(f"Company name for code {code} is {name}")
# Output: Company name for code 873693 is 阿为特

Example 3: Normalize Weekday Name

weekday_input = "礼拜一"
# Reverse lookup: find the standard key for this synonym
standard_weekday = None
for key, synonyms_list in synonyms.items():
    if isinstance(synonyms_list, list) and weekday_input in synonyms_list:
        standard_weekday = key
        break

print(f"Standard weekday for '{weekday_input}' is '{standard_weekday}'")
# Output: Standard weekday for '礼拜一' is '周一'

Visual Diagram

Since synonym.json is a utility data file containing key-value mappings, a flowchart showing the main types of mappings and their relationships is suitable.

flowchart TD
    A[Company Name] <--> B[Company Code]
    C[Temporal Terms] --> D[Synonyms List]
    E[Weekday Names] --> F[Synonyms List]
    G[Other Terms] --> H[Synonyms or Equivalent]

    style A fill:#f9f,stroke:#333,stroke-width:1px
    style B fill:#f9f,stroke:#333,stroke-width:1px
    style C fill:#bbf,stroke:#333,stroke-width:1px
    style D fill:#bbf,stroke:#333,stroke-width:1px
    style E fill:#bbf,stroke:#333,stroke-width:1px
    style F fill:#bbf,stroke:#333,stroke-width:1px
    style G fill:#bbf,stroke:#333,stroke-width:1px
    style H fill:#bbf,stroke:#333,stroke-width:1px

Summary

synonym.json is an extensive, bidirectional synonym dictionary primarily mapping Chinese company names to their stock codes and vice versa. It also includes important temporal and weekday synonyms, facilitating natural language understanding and data normalization in financial and business applications. The file serves as a foundational reference for systems requiring consistent entity resolution and synonym handling.


If integrating this file into a project, it should be loaded as a lookup dictionary used for:

No executable code is embedded; its value lies in the comprehensive and structured data it provides.