Welcome to Incels.is - Involuntary Celibate Forum

Welcome! This is a forum for involuntary celibates: people who lack a significant other. Are you lonely and wish you had someone in your life? You're not alone! Join our forum and talk to people just like you.

do you have any improvement suggestions for my java nigger translator ?

fukurou

fukurou

the supreme coder
★★★
Joined
Dec 17, 2021
Posts
2,296
Java:
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class GhettoTranslator {
    public HashMap<String, String> replacers = new HashMap<String, String>();
    public HashMap<String, String> speeder = new HashMap<String, String>();
    private RegexUtil regexUtil = new RegexUtil();
    public GhettoTranslator() {
        super();
        replacers.put("be", "beez");
        replacers.put("for", "fo");
        replacers.put("bitch", "biotch");
        replacers.put("dollar", "dolla");
        replacers.put("money", "cha ching");
        replacers.put("shit", "shii");
        replacers.put("ass", "azz");
        replacers.put("drink", "drank");
        replacers.put("car", "ride");
        replacers.put("wheels", "rimz");
        replacers.put("watermelon", "watameron");
        replacers.put("friends", "homeez");
        replacers.put("girlfriend", "bu");
        replacers.put("boyfriend", "boo");
        replacers.put("finger", "finguh");
        replacers.put("hair", "weave");
        replacers.put("hell", "hayl");
        replacers.put("what is up", "sap");
        replacers.put("how are you", "sup");
        replacers.put("nigger", "nigga");
        replacers.put("i agree", "my nigga");
        replacers.put("there", "der");
        replacers.put("was", "wuz");
        replacers.put("that", "dat");
        replacers.put("something", "some");
        replacers.put("driving", "whipping");
        replacers.put("know what i meat", "nahmeen");
        replacers.put("cigarette", "cig");
        replacers.put("stupid", "fu");
        replacers.put("fool", "fu");
        replacers.put("butt", "cake");
        replacers.put("family", "fambly");
        replacers.put("me", "your girl");
        replacers.put("ing", "in");
        replacers.put("of them", "um");
        replacers.put("str", "shkr");
        replacers.put("going to", "gonna");
        replacers.put("got to", "gotta");
        replacers.put("want to", "wanna");
        replacers.put("let me", "lemme");
        replacers.put("give me", "gimme");
        replacers.put("out to", "outta");
        replacers.put("king of", "kinda");
        replacers.put("i am going to", "eye ma");
        replacers.put("i am a", "eye ma");
        replacers.put("have to", "hafta");
        replacers.put("do not know", "dunno");
        replacers.put("did not do", "dindu");
        replacers.put("nothing", "naffin");
        // anti glitch :
        replacers.put("haylo", "wasup");
    }

    public String translate(String material) {
        String result = material;
        Iterator hmIterator = replacers.entrySet().iterator();
        while (hmIterator.hasNext()) {
            Map.Entry mapElement = (Map.Entry) hmIterator.next();
            String key = (String) mapElement.getKey();
            String value = (String) mapElement.getValue();
            result = result.replace(key, value);
        }
        String[] words = result.split("\\s+"); // splits by whitespace
        for (String word : words) {
            if (word.substring(word.length() - 1).equals("s")) {
                result = result.replace(word, word + "es");
            }
        }
        return result;
    }
}
 
don't need super() in constructor if it doesn't extend anything
 
Write the words in a file and then read each line and push it into the hashmap. You could make a function that does that and then call it into the constructor

Instead of doing multiple puts calls like a beta coder.
 
Last edited:
Write the words in a file and then read each line and push it into the hashmap. You could make a function that does that and then call it into the constructor

Instead of doing multiple puts function like a beta coder.
could you show me an example ?
 
The fact that you didn't write it with Soython means you are based.
 
The fact that you didn't write it with Soython means you are based.
python is the best if your app runs on a computer. I know java kotlin and python
next I wanna learn swift as well
 
White spaces should not be part of a languages syntax. Only the soyest and dumbest of all beings does such thing.
 
White spaces should not be part of a languages syntax. Only the soyest and dumbest of all beings does such thing.
wasn't project aiko written in python tho ?
 
wasn't project aiko written in python tho ?
I don't know what that is.
I don't care either.
Even if god was written in python I'd still shit on it as long as white spaces are syntax.
 
public HashMap<String, String> speeder = new HashMap<String, String>();

This isn't being used. Why is the line there?
 
Jfl dude calls himself “the supreme coder” :feelskek:
Java:
import android.content.Context
import android.content.SharedPreferences

class SharedPrefDB(private val context: Context) : AbsDictionaryDB() {
    private val sharedPreferences: SharedPreferences
    private val editor: SharedPreferences.Editor

    init {
        this.sharedPreferences = this.context.getSharedPreferences("t800", Context.MODE_PRIVATE)
        this.editor = this.sharedPreferences.edit()
    }

    override fun save(key: String, value: String) {
        editor.putString(key, value)
        editor.apply()
        editor.commit()
    }

    override fun load(key: String): String {
        val result = sharedPreferences.getString(key, "null")
        this.existsInDB = result != "null"
        return result!!
    }
}

bitch
 
which one does it choose for the terms that have 2 translations such as 'fu' and 'eye ma'
 

Users who are viewing this thread

shape1
shape2
shape3
shape4
shape5
shape6
Back
Top