"""
This module implements the main functionality of internet words.

Author: Qadeer Ahmad
LinkedIn: https://www.linkedin.com/in/mr-qadeer-3499a4205/
"""

__author__ = "Qadeer Ahmad"
__email__ = "mrqadeer1231122@gmail.com"
__status__ = "developing"


import re

class CustomErrorHandling(Exception):
    def __init__(self, error_message) -> None:
        print(f"{error_message}")

def words_remover(text:str,is_token:bool=False):
    """_summary_
        This module will help to remove the internet words from any given string. Helpful for NLP tasks

    Args:
        text (str): input string of any to work with
        is_token (bool, optional): for tokenization the string after replacing  Defaults to False.

    Raises:
        CustomErrorHandling: This class helps to raise only type error 

    Returns:
        _type_: This function returns a string if is_token is False else returns list of tokens words.
    """
        
        
    internet_words_dict = {
    'PLZ':'please',
    'PL':'please',
    'WTH':'hho the hell',
    'GM': 'good morning',
    'GN': 'good night',
    'LOL': 'laughing out loud, laugh out loud',
    'OMG': 'oh my god',
    'OMH': 'oh my heart',
    'OMG!': 'oh my god',
    'OMH!': 'oh my heart',
    'OM': 'oh my!',
    'OML': 'oh my lord',
    'PTL': 'praise the lord',
    'LYS': 'love yourself',
    'YK': 'you know',
    'AYT': 'are you there (or alright)',
    'WB': 'welcome back',
    'DNC': 'do not care',
    'SMT': 'sucking my teeth',
    'WBK': 'we been knew',
    'IMK': 'in my knowledge',
    'W/O': 'without',
    'FWB': 'friends with benefits',
    'PO': 'peace out',
    'ACC': 'account',
    'W/E': 'whatever',
    'NGL': 'not going to lie',
    'BRT': 'be right there',
    'DTM': 'dead to me (or doing too much)',
    'MBN': 'must be nice',
    'IYKYK': 'if you know, you know',
    'MFW': 'my face when',
    'TFW': 'that feel when',
    'IMO': 'in my opinion',
    'IMHO': 'in my humble opinion (or in my honest opinion)',
    'BTW': 'by the way',
    'DW': "don't worry",
    'IK': 'I know',
    'IC': 'I see',
    'IDK': "I don't know",
    'LMK': 'let me know',
    'MN': 'me neither',
    'IKR': 'I know, right',
    'TBH': 'to be honest',
    'TBVH': 'to be very honest',
    'TGIF': "thank god it's Friday",
    'TBT': 'throwback Thursday',
    'ROFL': 'rolling on the floor laughing',
    'LMAO': 'laughing my a** off',
    'LMFAO': 'laughing my f****** a** off',
    'ROFLMAO': 'rolling on the floor laughing my a** off',
    'AH': 'ar*ehole (or, less commonly, at home)',
    'BRB': 'be right back',
    'BBL': 'be back later',
    'TTYL': 'talk to you later',
    'THX': 'thanks',
    'TY': 'thank you',
    'TYSM': 'thank you so much',
    'TFTI': 'thanks for the invite',
    'YW': "you're welcome",
    'ASAP': 'as soon as possible',
    'POV': 'point of view',
    'BD': 'big deal',
    'NBD': 'no big deal',
    'OMW': 'on my way',
    'OTW': 'on the way',
    'DIY': 'do it yourself',
    'AKA': 'also known as',
    'SMS': 'short message service',
    'MMS': 'multimedia messaging service',
    'OATUS': 'on a totally unrelated subject',
    'ICYMI': 'in case you missed it',
    'STFU': 'shut the **** up',
    'BF': 'boyfriend; best friend',
    'GF': 'girlfriend',
    'SO': 'significant other',
    'BFF': 'best friend forever',
    'BFFL': 'best friend(s) for life',
    'LDR': 'long-distance relationship',
    'ILY': 'I love you',
    'ILYSM': 'I love you so much',
    'PDA': 'public display of affection',
    'YOLO': 'you only live once',
    'WTG': 'way to go!',
    'B4': 'before',
    'IRL': 'in real life',
    'ISO': 'in search of',
    'TMI': 'too much information',
    'TIL': 'today I learned',
    'VM': 'voice message',
    'ATM': 'at the moment',
    'RN': 'right now',
    'RFN': 'right ******* now!',
    'ATP': 'at this point',
    'BYOB': 'bring your own beer',
    'CU': 'see you',
    'Cya': 'see ya',
    'HMU': 'hit me up',
    'CMB': 'call me back',
    'UR': "you are (you're) (or your)",
    'FYI': 'for your information',
    'FOMO': 'fear of missing out',
    'JOMO': 'joy of missing out',
    'GR8': 'great',
    'SMH': 'shaking my head',
    'SMDH': 'shaking my damn head',
    'L8R': 'later',
    'JMO': 'just my opinion',
    'NVM': 'never mind',
    'GL': 'good luck',
    'GG': 'good game',
    'FWIW': "for what it's worth",
    'GBU': 'god bless you',
    'IMNSHO': 'in my not-so-humble opinion',
    'TL;DR': "too long; didn't read",
    'QOTD': 'quote of the day',
    'TBF': 'to be frank (or to be fair)',
    'DKDC': "don't know, don't care",
    'IDC': "I don't care",
    'IDGAF': "I don't give a ****",
    'IDGI': "I don't get it",
    'CBA': "can't be ar*ed",
    'K': 'okay',
    'GTG': 'got to go',
    'G2G': 'got to go',
    '2NITE': 'tonight',
    'CWOT': 'complete waste of time',
    'MU': 'miss you',
    'IMU': 'I miss you',
    'IMY': 'I miss you',
    'SSDD': 'same stuff, different day',
    'XOXO': 'hugs and kisses',
    'NE1': 'anyone',
    'OTT': 'over the top',
    'PLZ': 'please',
    'PLS': 'please',
    'DM': 'direct message',
    'PM': 'private message',
    'UOK': "you okay?",
    'RUOK': "are you okay?",
    'MIA': 'missing in action',
    'AWOL': 'absent without leave',
    'AFK': 'away from keyboard',
    'BAK': 'back at keyboard',
    'HBD': 'happy birthday',
    'SPK': 'speak',
    'SRY': 'sorry',
    'IMS': 'I am sorry',
    'MB': 'my bad',
        'SUP': "what's up?",
    'NM': 'not much (or nothing much)',
    'NTM': 'nothing much (or not too much)',
    'EZ': 'easy',
    'TTFN': 'ta ta for now',
    'TC': 'take care',
    'V': 'very',
    'VN': 'very nice (or voice note)',
    'HF': 'have fun',
    'U2': 'you too',
    'BAE': 'before anyone else',
    'WTF': 'what the ****',
    'WTM': "what's the matter?",
    'WYD': 'what you doing?',
    'Y?': 'why?',
    'JK': 'just kidding',
    'BC': 'because',
    'Cuz': 'because (or cousin)',
    'HRU': 'how are you?',
    'WYA': 'where you at?',
    'WBU': 'what about you?',
    'OBV': 'obviously',
    'OFC': 'of course',
    'RD': 'real deal',
    'WTW': "what's the word?",
    'WDYS': 'what do you say?',
    'BFN': 'bye for now',
    'B4N': 'bye for now',
    'TMRW': 'tomorrow',
    'NMU': 'not much, you?',
    'GJ': 'good job',
    'GTFO': 'get the **** out (or get the **** off)',
    'GTFOH': 'get the **** outta here',
    'IFHT': 'I f****** hate that',
    'NFW': 'no f****** way',
    'OIC': 'oh I see',
    'TMB': 'text me back (or text me b**ch)',
    'WYS': "whatever you say (or what you sayin'?)",
    'WDYT': 'what do you think?',
    'WTV': 'whatever',
    'FS': 'for sure',
    'FR': 'for real',
    'BR': 'be real',
    'BFR': 'be for real',
    'BFFR': 'be for f****** real',
    'RLY': 'really',
    'SRS': 'serious',
    'SRSLY': 'seriously',
    'NFS': 'no funny stuff (or no funny sh*t)',
    'PPL': 'people',
    'TYT': 'take your time',
    'AF': 'as **** (e.g., the new episode is cool AF)',
    'ASF': 'as **** (e.g., the new episode is cool AF)',
    'AS': 'as sh*t (e.g., the new episode is cool AS)',
    'STG': 'swear to god',
    'ISTG': 'I swear to god',
    'FFS': "for ****'s sake",
    'FGS': "for god's sake",
    'DAE': 'does anyone else',
    'OOTD': 'outfit of the day',
    'OOMF': 'one of my friends',
    'FTW': 'for the win',
    'YKTV': 'you know the vibe',
    'M8': 'mate',
    'QT': 'cutie',
    'RT': 'retweet',
    'QRT': 'quote retweet',
    'PQRT': 'private quote retweet',
    'TWT': 'Twitter',
    'FB': 'Facebook',
    'WA': 'WhatsApp',
    'IG': 'Instagram',
    'YT': 'YouTube',
    'IYSWIM': 'if you see what I mean',
    'IYKWIM': 'if you know what I mean',
    'YMMV': 'your mileage may vary',
    'DAM': "don't ask me",
    'DND': 'do not disturb',
    'NOYB': 'none of your business',
    'SFW': 'safe for work',
    'ELI5': 'explain like I\'m 5',
    'AMA': 'ask me anything',
    'AFAIK': 'as far as I know',
    'IIRC': 'if I remember correctly',
    'IDTS': "I don't think so",
    'JSYK': 'just so you know',
    'HIFW': 'how I felt when',
    'JIC': 'just in case',
    'NSFL': 'not safe for life',
    'Sus': 'suspicious',
    'WYWH': 'wish you were here',
    'YGTI': 'you get the idea',
    'FTT': 'free to talk?',
    'F2T': 'free to talk?',
    'NIMBY': 'not in my backyard',
    'TBC': 'to be confirmed',
    'TBA': 'to be announced',
    'TBD': 'to be determined',
    'POC': 'point of contact',
    'VIP': 'very important person',
    'FAQ': 'frequently asked question(s)',
    'N/A': 'not applicable',
    'TIA': 'thanks in advance',
    'OOO': 'out of office',
    'IAM': 'in a meeting',
    'T&C': 'terms and conditions',
    'R&D': 'research and development',
    'NP': 'no problem',
    'NW': 'no worries',
    'EOD': 'end of day',
    'EOM': 'end of message',
    'COB': 'close of business',
    'OTJ': 'on-the-job',
    'ETA': 'estimated time of arrival',
    'EMBM': 'early morning business meeting',
    'AGM': 'annual general meeting',
    'AOB': 'any other business',
    'RFP': 'request for proposal',
    'RFQ': 'request for quotation',
    'RFI': 'request for information',
    'PFA': 'please find attached',
    'FYA': 'for your action',
    'FYR': 'for your reference',
    'PS': 'post scriptum',
    'AR': 'action required',
    'PRB': 'please reply by',
    'NRN': 'no reply necessary',
    'Y/N': 'yes or no',
    'NDA': 'non-disclosure agreement',
    'LOI': 'letter of intent',
    'MOU': 'memorandum of understanding',
    'CTA': 'call to action',
    'SOP': 'standard operating procedure',
    'ROI': 'return on investment',
    'VFM': 'value for money',
    'CTR': 'click-through rate',
    'KPI': 'key performance indicator',
    'PMO': 'project management office',
    'SME': 'subject matter expert',
    'B2B': 'business-to-business',
    'B2C': 'business-to-consumer',
    'BOGOF': 'buy one get one free',
    'FF': 'follow Friday',
    'OTP': 'one-time password',
    'HTH': 'hope this helps',
    'OSM':'Awesome'}

        # checking if the input is string or not
    if isinstance(text,str):
        # replacing words
        replaced_string = ' '.join(internet_words_dict.get(word.upper(), word) for word in text.split())
        # if you want tokens as well
        if is_token==True:
            return replaced_string.split()
        return replaced_string
    else:
        raise CustomErrorHandling("Type Error! Accept only string")
