/* --- AUTOGENERATED FILE -----------------------------
* If you make changes to this file delete this comment.
* Otherwise the file may be overwritten in the future.
* --------------------------------------------------- */

const { mergeLocMatchGroups } = require('../lib/matching/utils');
const { regexMatchLocs } = require('../lib/matching/regexMatch');

const allSetSrc = {
  type: 'website',
  url: 'https://resources.allsetlearning.com/chinese/grammar/ASG81QV3',
  name: 'AllSet Chinese Grammar Wiki',
};

module.exports = {
  id: 'haoBuRongyi',
  structures: [
    'Subj. + 好容易 / 好不容易 + 才 + Verb,[Result Sentence]',
    'Verb / [Verb Phrase] + 好容易 / 好不容易',
  ],
  description:
    '好不容易 (hǎo bù róngyì) means "very difficult" or "really not easy." It is often used where the speaker wants to comment on the result of their hard work, something like "It was really hard for me do to do x, but then I realized y."',
  sources: [allSetSrc],
  match: sentence =>
    mergeLocMatchGroups([
      regexMatchLocs(sentence.text, /((?:好容易|好不容易)才)/),
      regexMatchLocs(sentence.text, /((?:好容易|好不容易))/),
    ]),
  examples: [
    {
      zh: '我们好不容易才做完这个项目,结果合同取消了。',
      en:
        'With great difficulty, we finally finished this project. As a result, the contract is up.',
      src: allSetSrc,
    },
    {
      zh: '我好不容易才到市中心,却发现没带手机,只好回去拿。',
      en:
        'It took me a long time to reach the city center, then I realized I had forgotten my cell phone and had to go back and get it.',
      src: allSetSrc,
    },
    {
      zh: '金融危机之后他好不容易才找到工作,现在又辞职了。',
      en:
        "After the financial crisis, he had a hard time finding a job. Now he's resigning.",
      src: allSetSrc,
    },
    {
      zh: '我好不容易才打通了银行的服务热线。',
      en:
        'With great difficulty, they finally climbed to the top of the mountain.As a result,it started raining heavily.',
      src: allSetSrc,
    },
    {
      zh: '他们好不容易才爬到了山顶,结果下起了大雨。',
      en: 'They.',
      src: allSetSrc,
    },
    {
      zh: '要完成这个大项目好不容易啊。',
      en: 'Finishing this big project will not be an easy task.',
      src: allSetSrc,
    },
    {
      zh: '养大一个孩子好不容易。',
      en: 'Raising a child is not an easy thing to do.',
      src: allSetSrc,
    },
    {
      zh: '创办一个公司好不容易啊。',
      en: "Starting a company isn't easy.",
      src: allSetSrc,
    },
  ],
};
