Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returns list with single character entries #1

Open
ungeschneuer opened this issue Aug 23, 2021 · 3 comments
Open

Returns list with single character entries #1

ungeschneuer opened this issue Aug 23, 2021 · 3 comments

Comments

@ungeschneuer
Copy link

I used a text which has a \n on every single line but not paragraphs because that's how I got the text. When using the scorer function, I get a list with every single character as its own entry as return.

Here is part of my example file:

Beginn: 10.00 UhrPräsident Dr. Norbert Lammert: \nDie Sitzung ist eröffnet.\nLiebe Kolleginnen und Kollegen! Ich begrüße Sie alle\nherzlich, wünsche Ihnen einen guten Morgen und uns\neine interessante Sitzungswoche. \nVor Eintritt in die Tagesordnung gratuliere ich der\nKollegin Heidemarie Wieczorek-Zeul, die am 21. No-\nvember ihren 65. Geburtstag gefeiert hat, im Namen des\nganzen Hauses herzlich. Alle guten Wünsche für die\nnächsten Jahre!\n(Beifall)\nWir kommen nun zum Tagesordnungspunkt I:\nEidesleistung des Bundesministers für Arbeit\nund Soziales\nDer Herr Bundespräsident hat mir mit Schreiben vom\n21. November dieses Jahres Folgendes mitgeteilt:\nGemäß Artikel 64 Absatz 1 des Grundgesetzes für\ndie Bundesrepublik Deutschland habe ich heute auf\nVorschlag der Frau Bundeskanzlerin den Bundes-\nminister für Arbeit und Soziales, Herrn Franz\nMüntefering, aus seinem Amt als Bundesminister\nentlassen und Herrn Olaf Scholz zum Bundesminis-\nter für Arbeit und Soziales ernannt. \nNach Art. 64 Abs. 2 des Grundgesetzes leistet ein\nBundesminister bei der Amtsübernahme den in Art. 56\nvorgesehenen Eid.\nHerr Bundesminister Scholz, ich darf Sie zur Eides-\nleistung zu mir bitten.\n(Die Anwesenden erheben sich)\nHerr Minister, ich darf Sie bitten, den Eid zu leisten. \nOlaf Scholz, Bundesminister für Arbeit und Sozia-\nles: \nIch schwöre, dass ich meine Kraft dem Wohle des\ndeutschen Volkes widmen, seinen Nutzen mehren, Scha-\nden von ihm wenden, das Grundgesetz und die Gesetze\ndes Bundes wahren und verteidigen, meine Pflichten ge-wissenhaft erfüllen und Gerechtigkeit gegen jedermann\nüben werde.

and this is what I get out

'i'], ['a'], ['r'], ['d'], ['e'], ['n'], [' '], ['E'], ['u'], ['r'], ['o'], [' '], ['d'], ['a'], ['s'], [' '], ['m'], ['e'], ['i'], ['s'], ['t'], ['e'], [' '], ['G'], ['e'], ['l'], ['d'], [' '], ['g'], ['e'], ['b'], ['u'], ['n'], ['d'], ['e'], ['n'], ['.'], [' '], ['D'], ['e'], ['r'], ['\n'], ['A'], ['u'], ['s'], ['b'], ['a'], ['u'], [' '], ['d'], ['e'], ['r'], [' '], ['B'], ['r'], ['e'], ['i'], ['t'], ['b'], ['a'], ['n'], ['d'], ['v'], ['e'], ['r'], ['s'], ['o'], ['r'], ['g'], ['u'], ['n'], ['g'], [' '], ['i'], ['n'], [' '], ['d'], ['e'], ['n'], [' '], ['l'], ['ä'], ['n'], ['d'], ['l'], ['i'], ['c'], ['h'], ['e'], ['n'], [' '], ['R'], ['ä'], ['u'], ['-'], ['\n'], ['m'], ['e'], ['n'], [' '], ['–'], [' '], ['d'], ['a'], ['s'], [' '], ['i'], ['s'], ['t'], [' '], ['s'], ['c'], ['h'], ['o'], ['n'], [' '], ['g'], ['e'], ['n'], ['a'], ['n'], ['n'], ['t'], [' '], ['w'], ['o'], ['r'], ['d'], ['e'], ['n'], [' '], ['–'], [' '], ['i'], ['s'], ['t'], [' '], ['s'], ['e'], ['h'], ['r'], [' '], ['w'], ['i'], ['c'], ['h'], ['t'], ['i'], ['g'], ['.'], ['\n'], ['A'], ['b'], ['e'], ['r'], [' '], ['a'], ['u'], ['c'], ['h'], [' '], ['w'], ['i'], ['r'], [' '], ['s'], ['e'], ['h'], ['e'], ['n'], [' '], ['d'], ['a'], ['s'], [' '], ['–'], [' '], ['d'], ['a'], [' '], ['s'], ['i'], ['n'], ['d'], [' '], ['w'], ['i'], ['r'], [' '], ['m'], ['i'], ['t'], [' '], ['d'], ['e'], ['r'], [' '], ['F'], ['D'], ['P'], [' '], ['e'], ['i'], ['n'], ['e'],

@nise
Copy link

nise commented Dec 28, 2021

Same here. A better documentation is needed. Otherwise the project should marked as not maintained.

@Davidiusdadi
Copy link

Davidiusdadi commented Dec 7, 2023

yes README.md example / docs are plain wrong:

def dehyphen(self, paragraphs):
        return [self.dehyphen_paragraph(p) for p in paragraphs]

the function expects an array...

look at the tests instead of the README.md

good news is - it still seems to work 🎉

@kovaacs
Copy link

kovaacs commented May 19, 2024

@Davidiusdadi can you please be a bit more explicit as for how you got it to work? I tried passing a list to dehyphen, but that alone doesn't do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants