[关闭]
@scott180 2021-07-20T17:13:51.000000Z 字数 7725 阅读 912

笔名汉字频率分析

数据来自《书法练习轨迹--明月几时有》中关于本人笔名的记录。

笔名分析

  1. 当前笔名:无为徐生
  2. 注册多少app就有多少账号,所取的昵称大于等于账号数量,因为昵称可以修改。因此我的昵称(笔名)相当多,大家也都一样。
  3. 笔名就像姓名一样,同名现象相当普遍,因此很难准确找到目标对象。相比而言,邮箱 1021151991@qq.com 具有唯一性,是有效的也是本人常用的。

20210605

笔名

  1. 五字:明明之明夜、明明之夜夜、星夜无恒恒、秋水共长天
  2. 四字:明明如夜、明如夜天、明来天明、明明夜夜、星夜无恒、如松之盛、天下有道、青青子襟、右耀去明、无为徐生
  3. 三字:徐先生、明来其、名字清
  4. 二字:博尔、古林、明天、深岸、甲方、龙光、知一、五湖、星名、源线、小明、长天、风云
  5. 一字:徐、吾、风、明
  6. 字母:xyqmmrytxydascottscott180xy180xuyq123sc1jackJack2Java

分析

  1. 笔名总数:43个。其中:五字4个,四字10个,三字3个,二字13个,一字4个,字母9个。二字13个最多,三字3个最少。汉字‘明’出现次数最多,频率最高,共17次。
  2. 汉字频率:{"明":17,"夜":9,"天":6,"如":3,"徐":3,"星":3,"之":3,"恒":3,"无":3,"名":2,"生":2,"风":2,"青":2,"来":2,"长":2,"耀":1,"一":1,"清":1,"有":1,"下":1,"小":1,"源":1,"云":1,"尔":1,"五":1,"林":1,"龙":1,"甲":1,"水":1,"岸":1,"方":1,"为":1,"去":1,"吾":1,"线":1,"先":1,"光":1,"秋":1,"子":1,"道":1,"湖":1,"字":1,"博":1,"盛":1,"襟":1,"古":1,"知":1,"共":1,"深":1,"右":1,"其":1,"松":1}

20210708

笔名

  1. 六字:烟火尘埃落定
  2. 五字:明明之明夜、明明之夜夜、星夜无恒恒、秋水共长天、青青子衿天、明明如夜夜
  3. 四字:明明如夜、明如夜天、明来天明、明明夜夜、星夜无恒、如松之盛、天下有道、青青子襟、右耀去明、秋水长天、无为徐生、清风之明、昨夜星辰
  4. 三字:徐先生、明来其、名字清、一世界、雨中曲、天行健、明明了、明明夜
  5. 二字:博尔、古林、明天、深岸、甲方、龙光、知一、五湖、星名、源线、小明、长天、风云、老徐、迈克、改之、择之、星夜、一柏、小徐、风格、明业、明飞、问橐、明夜、明一、米明、明云、明也、玄明、斗米、明达
  6. 一字:徐、吾、风、明
  7. 字母:xyqmmrytxydascottscott180xyqinxy180xu180xuyq123sc1jackJack2Javawuhulongguang123scott123yxmtxydmmry

分析

  1. 笔名总数:81个。其中:六字1个,五字6个,四字13个,三字8个,二字32个,一字4个,字母17个。二字32个最多,六字1个最少。汉字‘明’出现次数最多,频率最高,共33次。
  2. 汉字频率:{"明":33,"夜":15,"天":9,"之":6,"徐":5,"星":5,"一":4,"如":4,"风":4,"青":4,"恒":3,"无":3,"长":3,"清":2,"名":2,"小":2,"云":2,"生":2,"水":2,"秋":2,"子":2,"来":2,"米":2,"耀":1,"老":1,"玄":1,"了":1,"有":1,"下":1,"源":1,"尔":1,"五":1,"世":1,"林":1,"斗":1,"尘":1,"龙":1,"定":1,"业":1,"昨":1,"中":1,"辰":1,"甲":1,"岸":1,"方":1,"改":1,"为":1,"去":1,"格":1,"落":1,"达":1,"吾":1,"线":1,"埃":1,"先":1,"迈":1,"光":1,"克":1,"界":1,"行":1,"柏":1,"橐":1,"道":1,"湖":1,"字":1,"博":1,"盛":1,"飞":1,"烟":1,"襟":1,"也":1,"古":1,"健":1,"知":1,"雨":1,"择":1,"火":1,"问":1,"共":1,"深":1,"曲":1,"右":1,"其":1,"松":1,"衿":1}

20210712

笔名

  1. 六字:烟火尘埃落定
  2. 五字:明明之明夜、明明之夜夜、星夜无恒恒、秋水共长天、青青子衿天、明明如夜夜
  3. 四字:明明如夜、明如夜天、明来天明、明明夜夜、星夜无恒、如松之盛、天下有道、青青子襟、右耀去明、秋水长天、无为徐生、清风之明、昨夜星辰、东门之旭、长风雨下、清风徐来、原味吐司、星星水源、和山以水
  4. 三字:徐先生、明来其、名字清、一世界、雨中曲、天行健、明明了、明明夜、西之白、东门之、东有雨、徐庶一、飞一飞、斜风细、明之夜
  5. 二字:博尔、古林、明天、深岸、甲方、龙光、知一、五湖、星名、源线、小明、长天、风云、老徐、迈克、改之、择之、星夜、一柏、小徐、风格、明业、明飞、问橐、明夜、明一、米明、明云、明也、玄明、斗米、明达、徐生、四海、广毅、麦克、和时、尚書
  6. 一字:徐、吾、风、明
  7. 字母:xyqmmrytxydascottscott180xyqinxy180xu180xuyq123sc1jackJack2Javawuhulongguang123scott123yxmtxydmmry

分析

  1. 笔名总数:100个。其中:六字1个,五字6个,四字19个,三字15个,二字38个,一字4个,字母17个。二字38个最多,六字1个最少。汉字‘明’出现次数最多,频率最高,共34次。
  2. 汉字频率:{"明":34,"夜":16,"之":10,"天":9,"徐":8,"星":7,"风":7,"一":6,"水":4,"青":4,"长":4,"如":4,"清":3,"东":3,"生":3,"恒":3,"来":3,"飞":3,"无":3,"雨":3,"有":2,"下":2,"名":2,"小":2,"克":2,"子":2,"米":2,"和":2,"源":2,"云":2,"秋":2,"门":2,"耀":1,"老":1,"吐":1,"尔":1,"世":1,"尘":1,"业":1,"尚":1,"昨":1,"中":1,"甲":1,"改":1,"为":1,"格":1,"落":1,"吾":1,"先":1,"光":1,"界":1,"行":1,"橐":1,"道":1,"湖":1,"字":1,"博":1,"襟":1,"也":1,"健":1,"火":1,"共":1,"山":1,"味":1,"其":1,"海":1,"白":1,"松":1,"衿":1,"西":1,"广":1,"玄":1,"了":1,"五":1,"林":1,"斗":1,"龙":1,"定":1,"斜":1,"原":1,"麦":1,"辰":1,"庶":1,"岸":1,"方":1,"去":1,"达":1,"线":1,"埃":1,"毅":1,"细":1,"迈":1,"柏":1,"盛":1,"四":1,"烟":1,"古":1,"以":1,"知":1,"择":1,"旭":1,"问":1,"深":1,"曲":1,"右":1,"时":1,"司":1,"書":1}

明 释义

  1. 音: míng
  2. 首:
  3. 画: 8
  4. 行:
  5. 体:
  6. 笔: JEG
  7. 顺: 竖、横折、横、横、撇、横折钩、横、横
  8. 释义:
  9. 1.明亮(跟“暗”相对):~月。天~。灯火通~。
  10. 2.明白;清楚:问~。讲~。分~。去向不~。
  11. 3.公开;显露在外;不隐蔽(跟“暗”相对):~说。~令。~沟。~枪易躲,暗箭难防。
  12. 4.眼力好;眼光正确;对事物现象看得清:聪~。英~。精~强干。耳聪目~。眼~手快。
  13. 5.光明:弃暗投~。~人不做暗事。
  14. 6.视觉:双目失~。
  15. 7.懂得;了解:深~大义。不~利害。
  16. 8.表明;显示:开宗~义。赋诗~志。
  17. 9.明明,意思是显然如此:你~知道他不会,干吗还要为难他呀?
  18. 10.次于今年、今天的:~天。~晨。~年。~春。
  19. 11.朝代,公元13681644,朱元璋所建。先定都南京,永乐年间迁都北京。
  20. 12.姓。

java代码

  1. package cn.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import java.util.*;
  4. /**
  5. * 笔名汉字频率分析
  6. *
  7. * @author x
  8. * @date 2021/7/8 14:32
  9. */
  10. public class Test {
  11. public static void main(String[] args) {
  12. String text = "六字:烟火尘埃落定\n" +
  13. "五字:明明之明夜、明明之夜夜、星夜无恒恒、秋水共长天、青青子衿天、明明如夜夜\n" +
  14. "四字:明明如夜、明如夜天、明来天明、明明夜夜、星夜无恒、如松之盛、天下有道、青青子襟、右耀去明、秋水长天、无为徐生、清风之明、昨夜星辰、东门之旭、长风雨下、清风徐来、原味吐司、星星水源、和山以水\n" +
  15. "三字:徐先生、明来其、名字清、一世界、雨中曲、天行健、明明了、明明夜、西之白、东门之、东有雨、徐庶一、飞一飞、斜风细、明之夜\n" +
  16. "二字:博尔、古林、明天、深岸、甲方、龙光、知一、五湖、星名、源线、小明、长天、风云、老徐、迈克、改之、择之、星夜、一柏、小徐、风格、明业、明飞、问橐、明夜、明一、米明、明云、明也、玄明、斗米、明达、徐生、四海、广毅、麦克、和时、尚書\n" +
  17. "一字:徐、吾、风、明\n" +
  18. "字母:xyqmmry、txyda、scott、scott180、xyqin、xy180、xu180、xuyq123、sc1、jack、Jack2Java、wuhu、longguang123、scott123、yxm、txyd、mmry";
  19. StringBuffer buffer = new StringBuffer();
  20. buffer.append(statisticsNum(text));
  21. System.out.println(buffer.toString());
  22. }
  23. /*
  24. 笔名总数:100个。其中:六字1个,五字6个,四字19个,三字15个,二字38个,一字4个,字母17个。二字38个最多,六字1个最少。汉字‘明’出现次数最多,频率最高,共34次。
  25. 汉字频率:{"明":34,"夜":16,"之":10,"天":9,"徐":8,"星":7,"风":7,"一":6,"水":4,"青":4,"长":4,"如":4,"清":3,"东":3,"生":3,"恒":3,"来":3,"飞":3,"无":3,"雨":3,"有":2,"下":2,"名":2,"小":2,"克":2,"子":2,"米":2,"和":2,"源":2,"云":2,"秋":2,"门":2,"耀":1,"老":1,"吐":1,"尔":1,"世":1,"尘":1,"业":1,"尚":1,"昨":1,"中":1,"甲":1,"改":1,"为":1,"格":1,"落":1,"吾":1,"先":1,"光":1,"界":1,"行":1,"橐":1,"道":1,"湖":1,"字":1,"博":1,"襟":1,"也":1,"健":1,"火":1,"共":1,"山":1,"味":1,"其":1,"海":1,"白":1,"松":1,"衿":1,"西":1,"广":1,"玄":1,"了":1,"五":1,"林":1,"斗":1,"龙":1,"定":1,"斜":1,"原":1,"麦":1,"辰":1,"庶":1,"岸":1,"方":1,"去":1,"达":1,"线":1,"埃":1,"毅":1,"细":1,"迈":1,"柏":1,"盛":1,"四":1,"烟":1,"古":1,"以":1,"知":1,"择":1,"旭":1,"问":1,"深":1,"曲":1,"右":1,"时":1,"司":1,"書":1}
  26. */
  27. /**
  28. * 数量统计
  29. *
  30. * @param text
  31. * @return
  32. */
  33. private static String statisticsNum(String text) {
  34. String[] lineArr = text.split("\n");
  35. StringBuffer buffer = new StringBuffer();
  36. buffer.append("笔名总数:x个。其中:");
  37. StringBuffer nicknameText = new StringBuffer();
  38. Integer sum = 0;
  39. Integer max = 0;
  40. Integer min = 100;
  41. String maxText = "";
  42. String minText = "";
  43. Map<String, Integer> nicknameMap = new LinkedHashMap<>();
  44. for (String val : lineArr) {
  45. String[] nicknameArr = val.split(":");
  46. String[] nicknameArray = nicknameArr[1].split("、");
  47. int length = nicknameArray.length;
  48. sum += length;
  49. String num = nicknameArr[0] + length + "个";
  50. buffer.append(num).append(",");
  51. if (length > max) {
  52. maxText = num + "最多";
  53. max = length;
  54. }
  55. if (length < min) {
  56. minText = num + "最少";
  57. min = length;
  58. }
  59. if (!"字母".equals(nicknameArr[0])) {
  60. nicknameText.append(nicknameArr[1]).append("、");
  61. }
  62. for (String nickname : nicknameArray) {
  63. nicknameMap.put(nickname, nicknameMap.get(nickname) == null ? 1 : nicknameMap.get(nickname) + 1);
  64. }
  65. }
  66. // 笔名分析
  67. buffer.deleteCharAt(buffer.length() - 1).append("。").append(maxText).append(",").append(minText).append("。");
  68. String statisticsNum = buffer.toString().replace("x", String.valueOf(sum));
  69. // 单字频率
  70. Map<String, Integer> statisticsFrequencyMap = statisticsFrequency(nicknameText.toString());
  71. StringBuffer mostChineseChar = new StringBuffer();
  72. String maxNumChar = statisticsFrequencyMap.keySet().stream().findFirst().get();
  73. mostChineseChar.append("汉字‘").append(maxNumChar).append("’出现次数最多,频率最高,共").append(statisticsFrequencyMap.get(maxNumChar)).append("次。");
  74. // 笔名是否重复
  75. if (nicknameMap.size() != sum) {
  76. System.out.print("提示:笔名有重复,");
  77. nicknameMap.entrySet().stream().filter(nick -> nick.getValue() > 1).forEach(nick -> System.out.print(nick.getKey() + " "));
  78. System.out.println();
  79. System.out.println(nicknameText);
  80. System.out.println(JSON.toJSONString(nicknameMap));
  81. System.out.println();
  82. }
  83. return statisticsNum + mostChineseChar.toString() + "\n\n汉字频率:" + JSON.toJSONString(statisticsFrequencyMap);
  84. }
  85. /**
  86. * 单字频率统计
  87. *
  88. * @param text
  89. * @return
  90. */
  91. private static Map<String, Integer> statisticsFrequency(String text) {
  92. Map<String, Integer> map = new HashMap<>();
  93. for (int i = 0; i < text.length(); i++) {
  94. String val = text.substring(i, i + 1);
  95. if ("、".equals(val) || "\n".equals(val)) {
  96. continue;
  97. }
  98. map.put(val, map.get(val) == null ? 1 : map.get(val) + 1);
  99. }
  100. return sortMap(map);
  101. }
  102. /**
  103. * 按次数倒序
  104. *
  105. * @param map
  106. * @return
  107. */
  108. public static Map<String, Integer> sortMap(Map<String, Integer> map) {
  109. //利用Map的entrySet方法,转化为list进行排序
  110. List<Map.Entry<String, Integer>> entryList = new ArrayList<>(map.entrySet());
  111. //利用Collections的sort方法对list排序
  112. Collections.sort(entryList, new Comparator<Map.Entry<String, Integer>>() {
  113. @Override
  114. public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
  115. //正序排列,倒序反过来
  116. return o2.getValue() - o1.getValue();
  117. }
  118. });
  119. //遍历排序好的list,一定要放进LinkedHashMap,因为只有LinkedHashMap是根据插入顺序进行存储
  120. LinkedHashMap<String, Integer> linkedHashMap = new LinkedHashMap<String, Integer>();
  121. for (Map.Entry<String, Integer> e : entryList) {
  122. linkedHashMap.put(e.getKey(), e.getValue());
  123. }
  124. return linkedHashMap;
  125. }
  126. }

我的账号


添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注