Esempio n. 1
0
except ImportError:
    exit_error("An error occurred.\n"
               "Verify the SPPAS installation and try again. "
               "Full error message is: %s" % traceback.format_exc())

# ----------------------------------------------------------------------------
# SPPAS GUI is here:
# ----------------------------------------------------------------------------

# Logging
# ----------------------------------------------------------------------------

log_level = 1
log_file = None
try:
    setup_logging(log_level, log_file)
except Exception:
    # stdin is not available if pythonw is used instead of python, on Windows!
    log_file = os.path.join(
        os.path.dirname(os.path.dirname(os.path.dirname(PROGRAM))),
        "sppas.log")
    setup_logging(log_level, log_file)

# GUI is here:
# ----------------------------------------------------------------------------

app = wx.App(redirect=True)

# Fix preferences
prefsIO = Preferences_IO(SETTINGS_FILE)
if prefsIO.Read() is False:
Esempio n. 2
0
# force to add path
filenames = []
for f in args.files:
    p,b = os.path.split(f)
    if not p:
        p = os.getcwd()
    filenames.append(os.path.abspath(os.path.join(p,b)))

# Logging
# ----------------------------------------------------------------------------

log_level = 1
log_file = None
try:
    setup_logging(log_level, log_file)
except Exception:
    # stdin is not available if pythonw is used instead of python, on Windows!
    log_file = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(PROGRAM))), "sppas.log")
    setup_logging(log_level, log_file)

# GUI is here:
# ----------------------------------------------------------------------------

app = wx.App(redirect=True)

# Fix preferences
prefsIO = Preferences_IO(SETTINGS_FILE)
if prefsIO.Read() is False:
    prefsIO.SetTheme(sppasTheme())
Esempio n. 3
0
parser.add_argument("-o",
                    metavar="output",
                    required=False,
                    default=None,
                    help='Output directory name.')

parser.add_argument("--quiet", action='store_true', help="Disable the verbosity." )

if len(sys.argv) <= 1:
    sys.argv.append('-h')

args = parser.parse_args()

# ----------------------------------------------------------------------------
# Main program
# ----------------------------------------------------------------------------

if not args.quiet:
    setup_logging(1, None)
else:
    setup_logging(None, None)

train(pron_dict=args.r,
      mapping_table=args.m,
      protos_dir=args.p,
      corpus_dir_list=args.i,
      lang=args.l,
      working_dir=args.t,
      output_dir=args.o)
Esempio n. 4
0
parser.add_argument("--tok",
                    action='store_true',
                    help="Convert time-aligned tokens into their tokenization.")

parser.add_argument("--quiet",
                    action='store_true',
                    help="Disable the verbosity.")

if len(sys.argv) <= 1:
    sys.argv.append('-h')

args = parser.parse_args()

if not args.quiet:
    setup_logging(0, None)
else:
    setup_logging(30, None)

# ----------------------------------------------------------------------------
# Read

trs_input = sppas.src.annotationdata.aio.read(args.i)
trs_out = Transcription()

# ----------------------------------------------------------------------------
# Transform the PhonAlign tier to a Phonetization tier

try:
    align_tier = sppasSearchTier.aligned_phones(trs_input)
    logging.info("PhonAlign tier found.")