예제 #1
0
parser.add_argument("--basic",   action='store_true', help="Perform basic alignment if the aligner fails" )
parser.add_argument("--noclean", action='store_true', help="Do not remove working directory" )
parser.add_argument("--noactivity", action='store_true', help="Do not generate Activity tier" )
parser.add_argument("--nophntok",  action='store_true',  help="Do not generate PhnTokAlign tier" )

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

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

args = parser.parse_args()

# ----------------------------------------------------------------------------

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

# ----------------------------------------------------------------------------
# Automatic alignment is here:
# ----------------------------------------------------------------------------

# Fix resources
modelText = args.r # Acoustic model of the language of the text (required)
modelSpk = args.R  # Acoustic model of the mother language of the speaker (optional)

a = sppasAlign( modelText, modelSpk )

# Fix options
a.set_clean( True )
if args.noclean:
    a.set_clean( False )
예제 #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 and Gettext
# ----------------------------------------------------------------------------

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)

install_gettext()

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

app = wx.App( redirect=True )

# Fix preferences
prefsIO = Preferences_IO( SETTINGS_FILE )
if prefsIO.Read() is False: