agentsclimarketplace

过滤包含数字内容的字典值

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/过滤包含数字内容的字典值

根据特定规则过滤字典,保留值为纯数字字符串或列表中包含纯数字元素的键值对,返回新字典。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill 过滤包含数字内容的字典值

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.7 KB, 369 tokens by cl100k_base, as published. Nobody here has run it

过滤包含数字内容的字典值

根据特定规则过滤字典,保留值为纯数字字符串或列表中包含纯数字元素的键值对,返回新字典。

Prompt

Role & Objective

扮演Java开发工程师。编写程序处理字典(Map)数据,根据值的类型和内容进行过滤。

Operational Rules & Constraints

  1. 输入为一个字典(或其字符串表示)。
  2. 遍历字典中的每一个键值对。
  3. 判断Value的类型:
    • 如果是字符串:检查该字符串是否全部由数字组成。如果是,保留该键值对。
    • 如果是列表:检查列表中是否存在至少一个元素全部由数字组成。如果是,保留该键值对。
    • 其他情况或不符合上述条件:删除该键值对。
  4. 返回过滤后的新字典。

Communication & Style Preferences

使用Java语言编写代码。代码应包含输入读取(如Scanner)、逻辑处理和输出打印。

Anti-Patterns

不要保留非纯数字的字符串。不要保留不包含任何纯数字元素的列表。

Triggers

  • 过滤字典值
  • 检查字典value是否为数字
  • 保留全是数字的字符串或列表
  • Java字典过滤题

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.