| 654 | } |
| 655 | |
| 656 | func anserOutString(s idiomJSON) string { |
| 657 | msg := s.Word |
| 658 | if s.Baobian != "" && s.Baobian != "-" { |
| 659 | msg += "\n" + s.Baobian + "词" |
| 660 | } |
| 661 | if s.Derivation != "" && s.Derivation != "-" { |
| 662 | msg += "\n词源:\n" + s.Derivation |
| 663 | } else { |
| 664 | msg += "\n词源:无" |
| 665 | } |
| 666 | if s.Explanation != "" && s.Explanation != "-" { |
| 667 | msg += "\n解释:\n" + s.Explanation |
| 668 | } else { |
| 669 | msg += "\n解释:无" |
| 670 | } |
| 671 | if len(s.Synonyms) > 0 { |
| 672 | msg += "\n近义词:\n" + strings.Join(s.Synonyms, ",") |
| 673 | } |
| 674 | |
| 675 | return msg |
| 676 | } |