JackYumCha / QA

Question and Answer
0 stars 0 forks source link

Raw Salary for Analysis #8

Open JackYumCha opened 6 years ago

JackYumCha commented 6 years ago
[
  "Great Rems + End User + Parking + Generous Bonuses",
  "Generous salary neg. based on skills/experience",
  "$100000.00 - $120000.00 p.a.",
  "$130-150k pkg",
  "$150k - $200k p.a.",
  "$150k + Super",
  "Circa $1100+/ Day",
  "$95,297- $154,853 pa Level B - D (plus 17% super)",
  "$180k - $200k p.a. + super + benefits",
  "$91,743 - $98,127 p.a. plus super",
  "Generous Package. $90K - $120K + Super",
  "$160000.00 - $180000.00 p.a. + Bonus ",
  "$130000.00 - $150000.00 p.a.",
  "$60k - $80k p.a. + stocks",
  "$500-650 / day",
  "Highly attractive salary, perks and career-path",
  "$100,000 - $129,999",
  "$160,000 Base plus super",
  "$90k - $110k p.a. + Super ",
  "Cont or Perm - Up to $150k / $800pd",
  "$95,297- $154,853 pa Level B - D (plus 17% super)",
  "$170K - $210K Base Plus Bonus & Co Benifits",
  "Up to $140,000 + Super",
  "$140,000 - $150,000 + Super",
  "$95,297- $154,853 pa Level B - D (plus 17% super)",
  "Attractive salary plus generous staff benefits",
  "$75,000 + super, dependent on experience",
  "$85953 - $94644 p.a. + 17% super",
  "$120,000 - $169,999 + super",
  "$140k - $160k p.a. + super + bonus ",
  "bonuses",
  "Annual Salary depending on experience",
  "$140,000 - $150,000 + Super",
  "** $150-200k+ **",
  "AFP Band 7 $99,869 - $106,963",
  "Base + Super + Profit Share",
  "$150,000- $200,000 + Bens",
  "Highly attractive salary, perks and career-path",
  "Executive level salary package",
  "$140k - $160K",
  "$70000.00 - $140000.00 per annum",
  "$91,743 - $98,127 p.a. plus super",
  "$27,802 per year (2018), tax-free for three years",
  "$600 - $750 per day",
  "$120,000 plus super and bonus",
  "Make a positive career move today!",
  "AFP Band 7 $99,869 - $106,963",
  "$73k to $98k +17% super + leave loading",
  "$Neg",
  "Make a positive career move today!",
  "$45,000 - $54,999",
  "$800 - $850 per day",
  "$80k - $90k p.a. + super + bonus",
  "$700 - $1000 per day",
  "$90000 - $100000 per annum",
  "$73k to $98k +17% super + leave loading",
  "$80,000 plus 9.5% Super and $10000 Bonus",
  "Negotiable",
  "$90k - $120k p.a. + Super ",
  "$165k - $175k p.a. + Super+ Bonus (Flex) ",
  "3 months contract likely to extend",
  "Contract or PERM, Melb CBD, Influential Role",
  "$27,802 per year (2018), tax-free for three years",
  "Great Rems + End User + Sydney CBD",
  "Up to $150k p.a.",
  "Negotiable",
  "$80 - $100+ per hour",
  "$180,000 - $240,000 + Stock + Bens",
  "$140000.00 - $220000.00 per annum",
  "$140,000 - $150,000 + Super",
  "up to $650/day",
  "900 a Day",
  "$100000.00 - $130000.00 p.a.",
  "$150-165K + Super",
  "AFP Band 7 $99,869 - $106,963",
  "$92815 - $110220 p.a. + 17% Super",
  "Annual Salary depending on experience",
  "$92815 - $110220 p.a. + 17% Super",
  "$100k - $150k plus Super",
  "Attractive Annual Salary dep on exp.",
  "Competitive Daily Rates",
  "$NEG\r\nAll Agent Client Fees Disclosed",
  "Generous Package $120K - $150K + Super",
  "Competitive salary + super + shares!",
  "Competitive remuneration and benefits",
  "competitive",
  "$150,000 Package",
  "$120K-$140K Package (inclusive of super)",
  "$130-150k pkg",
  "$140,000",
  "$120,000 - $130,000 + super",
  "$91,743-$98,127 pa + 17% super + leave loading",
  "Package exceeds $200k",
  "$99,199 - $107,370 p.a. plus 9.5% superannuation",
  "Competitive Remuneration Package",
  "$80,000 - $100,000",
  "$80,000 - $119,999 + super + entrepreneurial leave",
  "3 months contract likely to extend",
  "$120,000",
  "Up to 190K + super + bonus",
  "Competitive Salary + Benefits",
  "Great Salary, 9-5ph, Modern Office",
  "$90000 - $140000 per annum",
  "AFP Band 7 $99,869 - $106,963",
  "$170,000-$280,000 + Bonus",
  "$160k - $180k p.a. + bonus",
  "$120,000 - $139,999",
  "Highly attractive salary, perks and career-path",
  "Up to $140,000 + Super",
  "$95,297 - $154,853 Level B-Level D, plus 17% super",
  "$165k - $175k p.a. + Super ",
  "Base + Super + Profit Share",
  "Up to $130000.00 p.a.",
  "$90,000 - $119,999",
  "Competitive Market Rate",
  "Base Salary plus Super and Bonus",
  "Circa $100k+ S \r\nCan increase for right profile",
  "Total remuneration: $92,338 to $117,729pa (HEW7/8)",
  "Generous Package $120K - $150K + Super",
  "Annual Salary depending on experience",
  "up to $650/day",
  "Negotiable",
  "$50,000 - $69,999 + super + entrepreneurial leave!",
  "$500 - $600 p.d.",
  "$150000 - $180000 per annum, Bens: Super",
  "$90k - $110k p.a. + Super",
  "Base+Super+Bonus",
  "$130-160k + Super & Bonus",
  "Highly Competitive Package",
  "Competitive salary + Benefits + great scope",
  "$200K +Package",
  "$800 - $850 p.d.",
  "$160k - $185k p.a.",
  "AU $109K to AU $128K plus up to 15.4% super",
  "$85953 - $94644 p.a. + 17% super",
  "$130-150k pkg",
  "AU $109K to AU $128K plus up to 15.4% super",
  "$90k - $110k + Super!",
  "$200K +Package",
  "$120K - 130K Base + Super + Bonus",
  "$150,000 - $200,000",
  "Annual Salary depending on experience",
  "Absolute top-end salary + lots of benefits",
  "$130k - $150k p.a.",
  "Make a positive career move today!",
  "$100K - $130K package plus bonuses",
  "$95,297 - $154,853 pa Level B-D, plus 17% super",
  "$140-170k + Super + Bonus",
  "$82143 - $88143 p.a. + 17% Super",
  "$81,784 - $92,265",
  "Negotiable",
  "Attractive salary & Flexible working environment",
  "$100,000 - $119,999",
  "Salary range: $85,680 - $91,969 per annum",
  "119Kp.a package + leave loading & up to 17% super",
  "Highly attractive salary, perks and career-path",
  "$170k - $185k p.a. + super + bonus + benefits ",
  "$120k - $140k p.a. + Super",
  "AU $109K to AU $128K plus up to 15.4% super",
  "Depends on Skills & Exp.",
  "Salary range: $85,680 - $91,969 per annum",
  "$140, 000",
  "$100,000 - $135,000",
  "$50,000 - $84,999",
  "$80,000 - $120,000 plus super",
  "$81,784 - $92,265",
  "Absolute top-end salary + lots of benefits",
  "$150k + Super",
  "up to $120k NZD",
  "110 - 120K+ Super",
  "Circa $100k+ S \r\nCan increase for right profile",
  "$81,784 - $92,265",
  "$180-$200K + Bonus",
  "$120,000 - $149,999",
  "Highly attractive salary, perks and career-path",
  "$100000",
  "$80,000 - $135,000 + Bens",
  "Up to $120000.00 p.a.",
  "$Competitive + Up to 20% Bonus",
  "Total remuneration: $92,338 to $117,729pa (HEW7/8)",
  "AFP Band 7 $99,869 - $106,963",
  "Competitive",
  "Up to $140,000 + Super",
  "$81,784 - $92,265",
  "Salary package dependant on experience",
  "$81,784 - $92,265",
  "AFP Band 7 $99,869 - $106,963",
  "Circa $1100+/ Day",
  "$200K +Package",
  "Or contract",
  "> $110k + Superannuation",
  "$60k - $90k",
  "$165k - $175k p.a. + Super+Bonus",
  "Competitive Salary + Benefits",
  "AFP Band 7 $99,869 - $106,963",
  "Up to $120000.00 p.a.",
  "Above market Base + Super",
  "$80 - $99.99 per hour",
  "Huge Rates + Benefits",
  "$130k - $150k p.a.",
  "Attractive package",
  "$81,784 - $92,265",
  "Multiple Contract Roles, $800-$1200 (NEG),Melb CBD",
  "£11000 - £130000 per annum, Bens: Fun/Bonuses",
  "$180000.00 - $200000.00 p.a. + Bonus ",
  "Very Competitive Salary + Benefits",
  "Competitive $$$",
  "AFP Band 7 $99,869 - $106,963",
  "100000",
  "Competitive salary + rewarding benefits",
  "Negotiable",
  "$95k - $103k p.a. + up to 15.4% super",
  "Up to $130k + Super + Perks",
  "Highly attractive package & performance incentives",
  "160-200k base",
  "Highly attractive salary, perks and career-path",
  "$92,143 - $130,151 per annum plus superannuation",
  "$95488 - $112940 p.a. + 17% super",
  "$80k - $91k plus up to 15.4% superannuation",
  "$120,000 - $149,999",
  "$80k to $91k plus up to 15.4% superannuation",
  "OTE $200-300k+ (Uncapped Commission)",
  "$500-600 pd /  $90-120k pa",
  "Around $150k-160k package",
  "Generous Package. $90K - $120K + Super",
  "Negotiable",
  "1100000",
  "$150,000 - $200,000",
  "$96394 - $110364 p.a. + 17% super",
  "$200K +Package",
  "Competitive salary + rewarding benefits",
  "Salary range: $85,680 - $114,967 per annum",
  "Competitive",
  "Generous Package. $90K - $120K + Super",
  "Around $150k-160k package",
  "Generous Package. $90K - $120K + Super",
  "$150k - $200000.00 p.a.",
  "up to $115,000 p.a.",
  "$80 - $94.99 per hour",
  "Competitive",
  "$170k - $190k p.a. + Bonus ",
  "$130-160k + Super & Bonus",
  "$110,000 - $130,000 + Super",
  "$145000.00 - $160000.00 p.a. + Including Super",
  "$130k + Super + Bonus (Negotiable)",
  "$70000.00 - $140000.00 per annum",
  "$99,199 - $107,370 p.a. plus 9.5% superannuation",
  "$140-150k inc super per annum",
  "Excellent Salary $300k package plus Co Benefits",
  "100 - 120k Base + super and bonus",
  "$500-600 pd /  $90-120k pa",
  "$130,000",
  "$95,297 - $154,853 Level B-Level D, plus 17% super",
  "Great Rates and Packages ",
  "$85,000 - $109,999 + Super + Fantastic benefits!",
  "$130,000 Package",
  "Challenge yourself to a new career!",
  "Competitive salary + rewarding benefits",
  "Fantastic new role - Immediate Start ",
  "$115,000 plus super plus salary packaging benefits",
  "$105909 - $113673 p.a.",
  "$96394 - $110364 p.a. + 17% super",
  "Up to $120000.00 p.a.",
  "$120k - $150k + Super",
  "$45.00 + super / hour",
  "$300,000 package",
  "Annual Salary depending on experience",
  "$100,000 - $129,999",
  "Great Rates and Packages ",
  "$90,000 - $135,000",
  "competitive",
  "$60,000 - $64,999",
  "$95,297 - $154,853 pa Level B-D, plus 17% super",
  "$90-95K + Super",
  "$100000.00 - $135000.00 per annum",
  "Super",
  "Very competitive salary package $$$",
  "Great Rems &  Location + End User & New Project",
  "Please State Hourly rate on Application",
  "$85000 - $90000 per annum",
  "$85 - $100+ per hour",
  "$120,000 - $189,999 + super",
  "Annual Salary depending on experience",
  "Great Rems & Location + End User & New Project",
  "$140k - $180k p.a.",
  "Great Rems & Location + End User & New Project",
  "$70-80k pa",
  "$80000 - $120000 per annum",
  "180,000",
  "AU $109K to AU $128K plus up to 15.4% super",
  "Circa $120,000 - $140,000 as per skills/experience",
  "up to $130,000",
  "$130,000 + Super",
  "Great Salary, 9-5ph, Modern Office",
  "Make a positive career move today!",
  "$60k - $80k p.a. + stocks",
  "US$200k - US$400k p.a. + Negotiable",
  "Great additional benefits ",
  "Super",
  "NZ$120,000k",
  "Competitive Salary",
  "Negotiable",
  "$95k - $103k p.a. + up to 15.4% super",
  "Super",
  "$300,000 package",
  "$80 - $99.99 per hour",
  "flexible working | great benefits ",
  "$73,597 - $121,478 + 9.5% super + leave loading",
  "$90000.00 - $130000.00 p.a. + Super",
  "$80,000 - $100,000 per annum + Plus Super",
  "Attractive Salary Package + benefits ",
  "$170k - $185k p.a. + super + bonus + benefits ",
  "$70,000 - $89,999",
  "Executive level salary package",
  "$100000.00 - $160000.00 p.a.",
  "Permanent",
  "Great Rems + End User + Sydney CBD",
  "$85,000 - $119,999",
  "130000",
  "Depends on experience",
  "Great Rems + End User + Sydney CBD",
  "$130,000 - $150,000",
  "Great Day Rates",
  "Salary range: $85,680 - $114,967 per annum",
  "US$200k - US$400k p.a. + Negotiable",
  "$55,000 - $59,999",
  "$90k - $100k p.a. + super + bonus + benefits ",
  "$60000.00 - $80000.00 p.a.",
  "Base + Salary + Super",
  "$20 - $24.99 per hour",
  "$110-130k base + super + bonus",
  "Super",
  "170,000",
  "Up to 140,000",
  "$120,000 - $140,000K + Super",
  "Contract Rates",
  "Base + Super + Profit Share",
  "Great Rems + End User + Parking + Generous Bonuses",
  "Market Leading $$$ + Stock options",
  "Competitive",
  "bonuses",
  "$100,000 - $149,999",
  "$100000 - $125000 per annum",
  "Competitive Salary",
  "Negotiable",
  "$150000.00 - $180000.00 p.a.",
  "Base + Super",
  "$130-150k pkg",
  "$60k - $70k p.a.",
  "$60k - $80k",
  "$100000.00 - $120000.00 p.a.",
  "Very Competitive Salary",
  "$110,000 - $135,000",
  "Base + Salary + Super",
  "Negotiable",
  "$100k - $140k p.a.",
  "$140-160k plus",
  "ronny@theonset.com.au",
  "$130-150k pkg",
  "$81,784 - $92,265",
  "$81,784 - $92,265",
  "$120k - $130k p.a. + Super",
  "$100K-$170K Negotiable",
  "$140k - $160K",
  "$450 - $480 p.d.",
  "20% Net Commission Only: $150,000 to $200,000/year",
  "Contract or PERM, Melb CBD, Influential Role",
  "Negotiable",
  "Competitive Daily Rate",
  "$80 - $99.99 per hour",
  "$135k - $160k p.a. + super + bonus ",
  "Join Asia Pacific’s pre-eminent life insurer!",
  "$140,000 - $150,000 + Super",
  "$73,597 - $121,478 + 9.5% super + leave loading",
  "$700 - $1000 per day",
  "Attractive salary plus generous staff benefits",
  "$94,910 - $112,364",
  "Highly attractive salary, perks and career-path",
  "$100000.00 - $135000.00 per annum",
  "Competitive salary + Benefits + great scope",
  "Package exceeds $200k",
  "$100k - $140k p.a. + plus super plus bonus",
  "$82143 - $88143 p.a. + 17% Super",
  "Attractive Remuneration Package",
  "$96394 - $110364 p.a. + 17% super",
  "Annual Salary Depending on Experience",
  "Great Salary, 9-5ph, Modern Office",
  "Salary range: $85,680 - $91,969 per annum",
  "$120k - $165k p.a.",
  "$90000.00 - $100000.00 p.a.",
  "$80,000 - $119,999 Based upon experience",
  "Competitive salary + Benefits + great scope",
  "$100000.00 - $140000.00 p.a.",
  "Base + Super + Comms ",
  "$80k to $91k plus up to 15.4% superannuation",
  "$95,297 - $154,853 pa Level B-D, plus 17% super",
  "$80,000 - $120,000",
  "Up to $130000.00 p.a.",
  "$130-150k pkg",
  "$90698 - $107706 p.a. + 17% superannuation contrib",
  "$95,297 - $154,853 Level B-Level D, plus 17% super",
  "$100K to $130K inc. Super plus bonuses",
  "$96394 - $110364 p.a. + 17% super",
  "Base + Super + Bonus ",
  "Absolute top-end salary + lots of benefits",
  "Negotiable",
  "Highly attractive salary, perks and career-path",
  "Negotiable",
  "$81,784 - $92,265",
  "Competitive Salary on offer",
  "$130-160k + Super & Bonus",
  "Are you an expert in machine learning algorithms?",
  "$90,000 - $110,000 plus Superannuation ",
  "$120k - $130k p.a. + Super",
  "Salary + 20 x PD days + Profit Share + Laptop",
  "Up to $150000.00 p.a.",
  "$90,000 - $120,000+ package based on experience",
  "$150K - 190K + super + bonus",
  "160-200k base",
  "Negotiable Base Salary + Super+ Mentoring",
  "Multiple Contract Roles, $800-$1200 (NEG),Melb CBD",
  "$100000.00 - $140000.00 p.a.",
  "$100,000 - $129,999",
  "$110k - $130k + Super!",
  "Negotiable",
  "$110,000 - $130,000 + Super",
  "Attractive Remuneration Package",
  "$80 - $99.99 per hour",
  "$120k - $130k p.a. + Super",
  "$150,000",
  "$95,297- $154,853 pa Level B - D (plus 17% super)",
  "Join Asia Pacific’s pre-eminent life insurer!  ",
  "$80k - $91k plus up to 15.4% superannuation",
  "Negotiable",
  "$70,000 - $89,999",
  "110k - 150k Plus Super",
  "$70000.00 - $140000.00 per annum",
  "from 75K inc super",
  "$120,000 - $130,000 + super",
  "$750-$900 per day",
  "Negotiable",
  "119Kp.a package + leave loading & up to 17% super",
  "Up to $150k p.a.",
  "$700 - $1000 per day",
  "$99,600 inclu super",
  "$145000.00 - $155000.00 p.a. + Including Super",
  "$90698 - $107706 p.a. + 17% superannuation contrib",
  "$130k - $150k p.a. + Super",
  "$70,000 with $200,000 OTE",
  "$120,000 - $140,000 + Super",
  "Generous Salary + Mentoring + Super",
  "$74,564 – $86,498 plus super",
  "Competitive Daily Rates",
  "Fantastic new role - Immediate Start ",
  "$70,000 - $94,000 plus super and share options",
  "$100K - $130K + Super + Benefits",
  "$30 - $39.99 per hour",
  "NA",
  "Competitive Salary + Benefits",
  "Salary range: $85,680 - $91,969 per annum",
  "$200000.00 - $240000.00 p.a. + Bonus ",
  "Negotiable",
  "$110,000 - $140,000 + Super + Equity",
  "Negotiable on skills and experience",
  "$120,000 + super",
  "$160k - $180k p.a. + plus super plus bonus",
  "Annual Salary depending on experience"
]
JackYumCha commented 6 years ago
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Xunit;
using JobModel.Entities;

namespace DataManagement
{
    public class SalaryAnalysis
    {

        [Fact(DisplayName = "Parse Salary")]
        public void ParseSalary()
        {
            string salaryFile = $@"{AppContext.BaseDirectory}\rawsalary.json";

            string json = File.ReadAllText(salaryFile);

            List<string> rawSalaries = JsonConvert.DeserializeObject<List<string>>(json);

            // we need to set up a set of rules to parse the json strings

            Regex rgxDigits = new Regex(@"\d+");

            rawSalaries = rawSalaries.Where(raw => rgxDigits.IsMatch(raw)).ToList();

            Func<string, Regex, AnnualSalary> convertExact = (string value, Regex rule) =>
            {
                Match match = rule.Match(value);
                if (match.Success)
                {
                    bool isDaily = match.Groups.Skip(2).Any(g => g.Value.ToLower() == "day");
                    bool hasK = false;
                    double price = match.Groups[1].Value.ToDouble(out hasK);
                    if (hasK)
                    {
                        price *= 1000d;
                    }
                    if (isDaily)
                    {
                        price *= 250d;
                    }
                    return new AnnualSalary()
                    {
                        Exact = price
                    };
                }
                return null;
            };

            Func<string, Regex, AnnualSalary> convertFromTo = (string value, Regex rule) =>
            {
                Match match = rule.Match(value);
                if (match.Success)
                {
                    bool hasKFrom = false, hasKTo = false;

                    bool isDaily = match.Groups.Skip(2).Any(g => g.Value.ToLower() == "day");

                    double from = match.Groups[1].Value.ToDouble(out hasKFrom);
                    double to = match.Groups[2].Value.ToDouble(out hasKTo);

                    bool hasK = hasKFrom || hasKTo;

                    if (hasK)
                    {
                        from *= 1000d;
                        to *= 1000d;
                    }
                    if (isDaily)
                    {
                        from *= 250d;
                        to *= 250d;
                    }
                    return new AnnualSalary()
                    {
                        From = from,
                        To = to
                    };
                }
                return null;
            };

            List<Regex> rulesExact = new List<Regex>()
            {
                new Regex(@"\$([\d,\.]+k?)\s*incl\w*\s*super", RegexOptions.IgnoreCase),
                new Regex(@"\$([\d,\.]+k?)\s*package", RegexOptions.IgnoreCase),
                new Regex(@"\$([\d,\.]+k?)\s*(Base|)\s*(plus|\+)\s*super", RegexOptions.IgnoreCase),
                new Regex(@"\$([\d,\.]+k?)\s*(per|\/)\s*(day)", RegexOptions.IgnoreCase),
                new Regex(@"\$([\d,\.]+k?)", RegexOptions.IgnoreCase),
            };

            List<Regex> rulesFromTo = new List<Regex>()
            {
                new Regex(@"\$([\d,\.]+k?)\s*-\s*\$?([\d,\.]+k?)\s*p.a.", RegexOptions.IgnoreCase),
                new Regex(@"\$([\d,\.]+k?)\s*-\s*\$?([\d,\.]+k?)\s*pkg", RegexOptions.IgnoreCase),
                new Regex(@"\$([\d,\.]+k?)\s*-\s*\$?([\d,\.]+k?)\s*(per|\/)\s*(day)", RegexOptions.IgnoreCase),
                new Regex(@"\$([\d,\.]+k?)\s*-\s*\$?([\d,\.]+k?)", RegexOptions.IgnoreCase),
            };

            List<AnnualSalary> annualSalaries = new List<AnnualSalary>();

            List<string> succeeded = new List<string>();

            foreach (var rule in rulesFromTo)
            {
                List<string> failed = new List<string>();

                foreach(var value in rawSalaries)
                {
                    var salary = convertFromTo(value, rule);
                    if(salary == null)
                    {
                        failed.Add(value);
                    }
                    else
                    {
                        annualSalaries.Add(salary);
                        succeeded.Add(value);
                    }
                }
                rawSalaries = failed;
            }

            foreach (var rule in rulesExact)
            {
                List<string> failed = new List<string>();

                foreach (var value in rawSalaries)
                {
                    var salary = convertExact(value, rule);
                    if (salary == null)
                    {
                        failed.Add(value);
                    }
                    else
                    {
                        annualSalaries.Add(salary);
                        succeeded.Add(value);
                    }
                }
                rawSalaries = failed;
            }

            Debugger.Break();
        }
    }

    public static class NumberConvert
    {
        public static double ToDouble(this string value, out bool hasK)
        {
            // 150 150k 200.3 100,000.24

            Regex regexK = new Regex("k$", RegexOptions.IgnoreCase);

            hasK = regexK.IsMatch(value);

            value = regexK.Replace(value.Replace(",", "").Replace(" ", ""), "");

            double result = double.NaN;

            if(double.TryParse(value, out result))
            {
                return result;
            }
            throw new Exception($"failed to convert string to double: {value}");
        }
    }

}