attribute error : str has no attribute remove
<p>I am sorry the last time I had used this website was my first time and I did not indent my code and all. But this time I tried to do so. I hope the code is understandable. I am working on a python program syllabifier.py written by Joshua Tauberer available from  <a href="https://p2tk.svn.sourceforge.net/svnrooot/p2tk/python/syllabify/syllabifier.py" rel="nofollow">https://p2tk.svn.sourceforge.net/svnrooot/p2tk/python/syllabify/syllabifier.py</a>. This program is free to use and also I have referenced the source in my project. I am using this program to syllabify the list of phonemes I have as an input. This program takes in an input file whose contents is like the following:</p>

<blockquote>
  <p>pau s aa m ih k l eh k t aa n ih t pau g eh l v ae n ih k pau aa p l ay k pau </p>
</blockquote>

<p>These are the phonemes generated from a speech file. pau stands for short pauses. Then this program syllabifies this input to produce an output like the following :</p>

<blockquote>
  <p>s aa ' m ih ' k l eh k ' t aa ' n ih t ' g eh l ' v ae ' n ih ' k aa ' p l ay k</p>
</blockquote>

<p>This output is the syllabified version. But the program generated this output when I manually deleted pau from the input file. As the program only recognizes phonemes and pau is not one. So I need to make a change in the program that would delete all existing pau from the list. I have copied here the main part of the program. I added the lines
text.remove("pau") and also tried by adding another one which is phoneme.remove("pau"). But with both cases I get an error saying: str object has no attribute remove. I do not understand where am I going wrong. Please help. Thank you very much. </p>

<pre><code>def syllabify(language, text) :

 text.remove("pau") 
 if type(text) == str :
    text = text.split()

 syllables = [] # This is the returned data structure.

 internuclei = [] # This maintains a list of phonemes between nuclei.

 for phoneme in text :
    #phoneme.remove("pau")
    phoneme = phoneme.strip()
    if phoneme == "" :
        continue
    stress = None
</code></pre>
