<commit_before>define(['js/core/Component', "sprd/error/ProductCreationError"],
    function (Component, ProductCreationError) {
        return Component.inherit("sprd.manager.ProductCreationErrorManager", {
            defaults: {
                errorMessage: null,
                copyrightErrorMessage: null
            },

            getErrorMessages: function (err) {
                var customerErrorMessage,
                    detailedErrorMessage;

                if (err instanceof ProductCreationError) {
                    if (err.baseError && err.baseError.xhr) {
                        detailedErrorMessage = err.baseError.xhr.responses.text;
                    }
                }

                if (err.xhr) {
                    if (err.xhr.status === 400) {
                        detailedErrorMessage = err.xhr.responses.text;
                    } else {
                        // 503 and 502 errors are handled somewhere else
                        return;
                    }
                }

                if (detailedErrorMessage && detailedErrorMessage.indexOf("blacklisted terms") !== -1) {
                    var matches = /.*'(.+)'.*\[(.+)\]/.exec(detailedErrorMessage);
                    // copy right error
                    customerErrorMessage = this.$.copyrightErrorMessage.replace("%0", matches[1]).replace("%1", matches[2]);
                } else {
                    customerErrorMessage = this.$.errorMessage;
                }

                return {
                    customerErrorMessage: customerErrorMessage,
                    detailedErrorMessage: detailedErrorMessage
                };
            }
        });
    });<commit_msg>set copyright word on copyright list<commit_after>define(['js/core/Component', "sprd/error/ProductCreationError"],
    function (Component, ProductCreationError) {
        return Component.inherit("sprd.manager.ProductCreationErrorManager", {
            defaults: {
                errorMessage: null,
                copyrightErrorMessage: null
            },

            getErrorMessages: function (err) {
                var customerErrorMessage,
                    detailedErrorMessage,
                    copyrightWord;

                if (err instanceof ProductCreationError) {
                    if (err.baseError && err.baseError.xhr) {
                        detailedErrorMessage = err.baseError.xhr.responses.text;
                    }
                }

                if (err.xhr) {
                    if (err.xhr.status === 400) {
                        detailedErrorMessage = err.xhr.responses.text;
                    } else {
                        // 503 and 502 errors are handled somewhere else
                        return;
                    }
                }

                if (detailedErrorMessage && detailedErrorMessage.indexOf("blacklisted terms") !== -1) {
                    var matches = /.*'(.+)'.*\[(.+)\]/.exec(detailedErrorMessage);
                    // copy right error
                    copyrightWord = matches[1];
                    customerErrorMessage = this.$.copyrightErrorMessage.replace("%0", matches[1]).replace("%1", matches[2]);
                } else {
                    customerErrorMessage = this.$.errorMessage;
                }

                return {
                    customerErrorMessage: customerErrorMessage,
                    detailedErrorMessage: detailedErrorMessage,
                    copyrightWord: copyrightWord
                };
            }
        });
    });
{'fraction_non_alphanumeric': 0.09669282511210762, 'fraction_numerical': 0.008127802690582959, 'mean_word_length': 1.2790549169859515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2001368', 'n_tokens_mistral': 837, 'n_tokens_neox': 753, 'n_words': 144}