<commit_before>package app.hongs.action;

import app.hongs.HongsException;
import app.hongs.util.Dict;
import app.hongs.util.Synt;
import app.hongs.util.verify.Default;
import app.hongs.util.verify.Defiant;
import app.hongs.util.verify.NoRepeat;
import app.hongs.util.verify.Optional;
import app.hongs.util.verify.Repeated;
import app.hongs.util.verify.Required;
import app.hongs.util.verify.Rule;
import app.hongs.util.verify.Verify;
import java.util.Iterator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 数据校验助手
 *
 * <h3>异常代码</h3>
 * <pre>
 * 代码区间 0x10f0~0x10ff
 * Ex10f1=找不到表单规则
 * </pre>
 *
 * <h3>特别注意</h3>
 * <p>
 * 在 form.xml 中,
 * 无 type 也无 rule 则同 type="string".
 * 无 required 时默认启用 Optional 规则,
 * 无 repeated 时默认启用 NoRepeat 规则,
 * 但 required=""表示既无 Required 也无 Optional,
 * 同 repeated=""表示既无 Repeated 也无 NoRepeat.
 * 依此规则 type="form" 或 rule 有 IsForm,Intact,
 * 或其他可接受集合类型取值时务必加上repeated="".
 * </p>
 *
 * @author Hongs
 */
public class VerifyHelper extends Verify {

    public VerifyHelper() {
        super();
    }

    public VerifyHelper addRulesByForm(Map map) throws HongsException {
        String conf = Dict.getValue(map, "", "@", "conf");
        String form = Dict.getValue(map, "", "@", "name");
        return addRulesByForm(conf, form , map);
    }

    public VerifyHelper addRulesByForm(String conf, String form) throws HongsException {
        Map    map  = FormSet.getInstance(conf)
                             .getForm/**/(form);
        return addRulesByForm(conf, form , map);
    }
<commit_msg>将关联助手 SpreadHelper 相关的操作并入选项助手 SelectHelper<commit_after>package app.hongs.action;

import app.hongs.HongsException;
import app.hongs.util.Dict;
import app.hongs.util.Synt;
import app.hongs.util.verify.Default;
import app.hongs.util.verify.Defiant;
import app.hongs.util.verify.NoRepeat;
import app.hongs.util.verify.Optional;
import app.hongs.util.verify.Repeated;
import app.hongs.util.verify.Required;
import app.hongs.util.verify.Rule;
import app.hongs.util.verify.Verify;
import java.util.Iterator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 数据校验助手
 *
 * <h3>异常代码</h3>
 * <pre>
 * 代码区间 0x10f0~0x10ff
 * Ex10f1=找不到表单规则
 * </pre>
 *
 * <h3>特别注意</h3>
 * <p>
 * 在 form.xml 中,
 * 无 type 也无 rule 则同 type="string".
 * 无 required 时默认启用 Optional 规则,
 * 无 repeated 时默认启用 NoRepeat 规则,
 * 但 required=""表示既无 Required 也无 Optional,
 * 同 repeated=""表示既无 Repeated 也无 NoRepeat.
 * 依此规则 type="form" 或 rule 有 IsForm,Intact,
 * 或其他可接受集合类型取值时务必加上repeated="".
 * </p>
 *
 * @author Hongs
 */
public class VerifyHelper extends Verify {

    public VerifyHelper() {
        super();
    }

    public VerifyHelper addRulesByForm(Map map) throws HongsException {
        String conf = Dict.getValue(map, "default", "@", "conf");
        String form = Dict.getValue(map, "default", "@", "name");
        return addRulesByForm(conf, form , map);
    }

    public VerifyHelper addRulesByForm(String conf, String form) throws HongsException {
        Map    map  = FormSet.getInstance(conf)
                             .getForm/**/(form);
        return addRulesByForm(conf, form , map);
    }

{'fraction_non_alphanumeric': 0.13375394321766562, 'fraction_numerical': 0.008832807570977918, 'mean_word_length': 3.39196675900277, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '934859', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1277, 'n_words': 249}